A couple of weeks back I released a new version of VMC Remote. This new version may not look different, but it definitely acts different.

Under the covers I've changed a lot of the way the remote functions in order to allow for multiple connection and server types. This means that you can use your choice of (2) media centre server applications - MCE Controller or VMC Controller. It also means that some day down the track I might be able to add the ability to use a different type of connection - say... Bluetooth - to connect to these server applications.

I've also uploaded a 10 minute video to youtube that gives you a quick look at the different versions of the remote on different devices. Here it is...

youtube - VMC Controller Introduction

One thing that's annoyed me for years when using SQL Server 2005 was that there are many inconsistencies in the UI. You'd think that the most obvious of these would be fixed in subsequent releases...

The most obvious one that I've always noticed is the Select Database File dialog. In some parts of SQL Management Studio, the standard windows Select File dialog is used for opening a file. In others, you get this:

image

I don't understand why this archaic piece of interface is still present today. It seriously looks like they gave the job of creating an open database dialog to a first year developer who couldn't find GetOpenFileName().

On Tuesday I had the pleasure of attending Remix 08 in Sydney.

The day really started on a high with the keynote. It opened with a video that showed off a few cool applications that have been developed in Australia using some of the latest Microsoft technologies such as Silverlight. That was followed by Mark Pesce's presentation that really drilled home the effect of technology on today's society in creating a state of "Hyperconnectivity" between people.

I tried quite hard to stick to the creative track and was rewarded very early with Jonas Follesoe's presentation. He showed how to use the Expression designer tools to create a truly amazing experience for Silverlight applications. His demo is available on his blog here.

I also managed to sit in on a few presentations by some fellow Readifarians - Philip Beadle and Tatham Oddie. Phil's presentation showed how to use some really simple programming techniques (such as binding & asynchronous WCF) with Silverlight 2 to create cool web applications. Tatham's presentation on MVC & AJAX was a really interesting take on possibilities of combining the two technologies in the future. Unfortunately, I missed Damo and Alister's presentations...

Overall, I really did enjoy this event. It's definitely one that I'll be attending again in the future.

Over the past couple of months I've put a fair few hours into a little side project of mine. The purpose of the project was to create a remote control for Vista Media Center PCs that would run on Windows Mobiles.

I'm happy to announce that I've finally released it! It's available on CodePlex at www.codeplex.com/vmcremote.

At the moment, there's a PPC 2003 and PPC 2003 SE version up for grabs in this initial release. I'm working on the Windows Mobile 6 versions as well.

All you need to get started is a device that can connect to your network and a media center running MCE Controller.

This thing has already come in handy for me, so I hope it's just as useful for others. I'm going to continue working on it as much as possible, because I don't think it's quite done.

Some coming features will include:

  • an improved UI
  • bluetooth connectivity
  • wake on LAN support
  • more targetted versions

Check it out!

www.codeplex.com/vmcremote

I started working for a new client a couple of weeks ago. This client provides a customised solution for PowerPoint with many weird and wonderful functions. Part of the work I'm doing here is helping them migrate their solution to work with PowerPoint 2007.

While I've discovered many wacky behaviours that have come about due to the new rendering engine used in Office 2007, I hadn't thrown my hands in the air and said "I can't do it" until the other day. Something as simple as adding a button into a context menu when a user right-clicks a picture just would not work. There was already code in the project that did this for earlier version of PowerPoint, but no matter what I did it would not work for 2007.

Needless to say, I started seeking help, thinking that I was just missing something. Coatsie to the rescue! Well, sort of... :)

Unable to customise context menus in PowerPoint 2007

Andrew's post basically shows how desperate I was by publishing my original email. Pathetic, hey...? :)

Anyway, the result was that you simply can't do it. Adding items to the context menu is considered "feature depricated" so the new rendering engine forbids it and moves on. So how to overcome this? From Andrew's post...

In summary, Microsoft recommends that you model your UI on Office’s own built-in Ribbon UI, specifically around the use of Contextual Tabs as the mechanism for displaying contextually relevant content. For each object type that the add-in supports, a tab could be added to the appropriate contextual tab set that would contain the Add-In-specific tools for working with that object. With this type of design, the UI would better match the UI of Office 2007, and the end-users could potentially not require much extra training on top of the training for Office 2007 itself. For more information, please check out the Office Fluent UI Style Guide at the Office Fluent Ribbon Developer Portal.

So the solution... Contextual Tab Sets! Now, I'm sure if I asked a room of 50 people what they were less than 2 would put their hand up. And googling it doesn't help too much either.

In short, there are the regular tabs in the Office Ribbon, and Contextual Tabs. The regular tabs are the ones that are always there. The contextual ones are the ones that only show up when something has been selected in the designer. They're usually highlighted a different colour too, so that they stand out.

One example of this is when you select a picture and a new Formatting tab pops up under the heading of Picture Tools. The Contextual Tab Set here is Picture Tools and the contextual tab is the Formatting tab.

One cool thing about the new Ribbon and all that Extensibility that's provided for Office is that you can easily add (and remove) tabs in a contextual tab set. There are plenty of samples out there that do Ribbon customisation, especially on Office Fluent User Interface Developer Portal. Though, not many of them show how to do this.

I won't go into creating a Ribbon Extensibility solution, instead I'll just mention that all you have to do is create an Add-In for PowerPoint in Visual Studio (preferably 2008) with VSTO and override the Add-In's CreateRibbonExtensibilityObject() method to return an object that implements IRibbonExtensibility. This object will implement the method GetCustomUI to return a string representation of the Ribbon XML.

Using the Custom UI XML, we can specify a Ribbon that simply adds a tab to any of these Contextual Tab Sets. The following snippet adds a "Custom" tab to the Drawing Tools tab set. The tab has a Hello World button in the Custom Group tab group.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon>
    <contextualTabs>
      <tabSet idMso="TabSetDrawingTools">
        <tab id="TabCustom" label="Custom">
          <group id="GroupCustomGroup" label="Custom Group">
            <button id="ButtonHelloWorld" tag="hello World" label="Hello World"
                    screentip="Displays a Hello World message box" onAction="OnHelloWorld" />
          </group>
        </tab>
      </tabSet>
    </contextualTabs>
  </ribbon>
</customUI>

So once you have an add-in that provides a Ribbon representation similar to this, you will see that setting focus to a shape gives you the Drawing Tools Contextual Tab Set with the Formatting and Custom tabs.

According to the information Andrew received, this is basically the way to provide any contextual functionality in Office going forward. I still think it's broken, but what can we do other than complain? :)

I've been writing up some demos for the Readify Pro .NET 3.5 course over the past couple of days and on a couple of occasions I've run into the situation of needing to time a set of operations. The way I usually approach this is to get the time from DateTime.Now before and after the operations and print the result to the screen. This was starting to become tedious:

long startTime = DateTime.Now.Ticks;
System.Threading.Thread.Sleep(1500);
long endTime = DateTime.Now.Ticks;
Console.WriteLine("Time Elapsed: {0}", new TimeSpan(endTime - startTime).TotalMilliseconds.ToString());

So, I decided to take a different approach. After using RhinoMocks I stumbled upon the MockRepository.Record method. This method can be used to wrap a set of mock statements in a using block. "Eureka!" I shout...

How do I accomplish this, now...? I want to have a StopWatch that has a Time method. I want to call the Time method with a using statement and time the statements that execute within the block. This means my Time method needs to return an object that implements IDisposable so that the Dispose method is hit at the end of the using block.

What shall the Time method return...? How about a Timer object? I know, I'm a creative genious! :)

 
public class Timer : IDisposable
{
    public DateTime StartTime { get; private set; }
    public DateTime EndTime { get; private set; }
    internal event EventHandler<TimerStoppedEventArgs> TimerStopped;

    public void BeginTiming()
    {
        StartTime = DateTime.Now; // Start the timer by recording the current time.
    }

    public void StopTiming()
    {
        EndTime = DateTime.Now; // Record the end time.
        OnTimingStopped(); // Call to raise the TimerStopped event.
    }

    protected virtual void OnTimingStopped()
    {
        TimeSpan span = EndTime - StartTime; // Create the TimeSpan that defines the elapsed time.
        if (TimerStopped != null) // Raise the TimerStopped event.
            TimerStopped(this, new TimerStoppedEventArgs(span));
    }

    public void Dispose()
    {
        if (EndTime == DateTime.MinValue) // We've hit the end of the using block! Stop the timer!
            StopTiming();
    }
}

/// <summary>
/// Describes a TimerStopped event by providing the elapsed time as a TimeSpan.
/// </summary>
internal class TimerStoppedEventArgs : EventArgs
{
    public TimeSpan ElapsedTime { get; set; }
    public TimerStoppedEventArgs(TimeSpan elapsedTime)
    {
        ElapsedTime = elapsedTime;
    }
}

Ok, now to utilise this in the StopWatch...

public class StopWatch
{
    Timer currentTimer; // The Timer currently in use.

    /// <summary>
    /// The total time that the StopWatch timed.
    /// </summary>
    public TimeSpan TotalElapsedTime { get; private set; }

    public Timer Time()
    {
        // Check to see the StopWatch isn't already in use.
        if (currentTimer != null) throw new InvalidOperationException("You are already using this StopWatch!");
        // Create a Timer, create an event handler for it's TimerStopped event, start it and return it.
        currentTimer = new Timer();
        currentTimer.TimerStopped += new EventHandler<TimerStoppedEventArgs>(currentTimer_TimerStopped);
        currentTimer.BeginTiming();
        return currentTimer;
    }

    public TimeSpan GetCurrentElapsedTime()
    {
        // Check to see the StopWatch is in use.
        if (currentTimer == null) throw new InvalidOperationException("You aren't timing anything...");
        return DateTime.Now - currentTimer.StartTime; // Return the current time - the timer's start time.
    }

    void currentTimer_TimerStopped(object sender, TimerStoppedEventArgs e)
    {
        if (e != null) // Set the total elapsed time of the StopWatch.
            TotalElapsedTime = e.ElapsedTime;
        if (currentTimer != null) // Kill the current Timer.
            currentTimer.TimerStopped -= new EventHandler<TimerStoppedEventArgs>(currentTimer_TimerStopped);
        currentTimer = null;
    }
}

That's it! 90 lines of code (including comments) and five minutes later I have a StopWatch. I even threw a GetCurrentElapsedTime method in there for fun too.

Now, to test it out...

StopWatch watch = new StopWatch();
using (watch.Time())
{
    System.Threading.Thread.Sleep(1500);
}
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

This was actually giving me around 1520ms. Hmm...

So I went back to my old method to test this out, and found that the following code ran with the same results... Excellent!

Ok, so using the DateTime.Now compare method isn't exactly going to be good for real time computing but, for demos and the like I think it will do the job. And it definitely makes the code look that little bit neater.

I've got a little sample available in my downloads for those interested.

Technorati Tags: ,

This week I've got the "luxury" of working from home. After my last 1-2 week stint of this back in March, I've decided to tackle things a little differently.

Firstly, I'm not breaking my routine! I've been going to the gym every morning for the past 7 weeks. It's really helped me feel better about myself. Last time I was working from home, I decided to give the gym a break for a little. What happened next was that I stopped going all together for about 3 months. So, breaking my routine is not going to happen this week.

Secondly, have a five minute break every hour. This is something that really got lost for me last time. I ended up sitting in my chair for 6 hours straight every day, not having anything to eat and relying on a bottle of water to keep me going. This is very bad behaviour and will really affect me now that I'm not changing my gym routine. Taking a quick walk around the house for five minutes every hour and ensuring I get some food into me every 2 hours is goal I will be actively pursuing.

Lastly, switch off the computer at 6PM every night, even if it doesn't stay off all night. This essentially reboots my brain. :)

So, what will I be doing this week...? Today I'm doing some more PD around the ASP.NET MVC. Hopefully I'll get some time to hit Silverlight 2, but at this stage it's not looking likely. Tomorrow I'll be doing some work on developing our new Professional .NET Course.

I'll try to keep active on my blog and I'll be twittering away as much as possible.

I'm famous: http://blogs.technet.com/itproaustralia/archive/2008/03/06/technet-vodcast-of-the-sydney-heroes-happen-2008-event.aspx

Watch out for the good looking guy at the end... :-p

I had a great time the other day at the launch event. It was great getting a chance to check out the new improvements in VS, SQL and Windows 2008. And I had a blast catching up with the DPE guys. The free copy of Vista and Windows Server will definitely not go to waste.

BTW, thanks for putting me on the spot Deeps... ;-)

Technorati Tags:

I managed to download and install IE8 today, after hearing it was available from the Microsoft web site.

The overall setup experience was quite painless, and it managed to keep all my settings from IE7.

The first page that loads after installing introduces the new features of IE8 - i.e. Activities, WebSlices and IE7 Emulation.

Activities

Activities give users ready access to the online services they care about most from any page they visit, and developers gain an easy way to extend the reach of their online services. It’s as simple as selecting text to get started with an Activity.

First up, I installed the Windows Live Translator activity and browsed to a site. Highlighting some text gave me a context menu that had the translator activity in it:

image

I thought this was quite a nice little feature... :)

 

WebSlices

Developers can mark parts of webpages as "WebSlices" and enable users to monitor information they rely on as they move about the web. With a click in the Favorites bar, users see rich "WebSlice" visuals and developers establish a valuable, persistent end-user connection.

So next I thought I'd try the Facebook WebSlice. I logged into facebook and installed the slice from the toolbar:

image

image

This put a new button in my favourites toolbar. But unfortunately, it didn't work too well...

image 

I also noticed that facebook wanted me to upgrade to IE6 or any other browser...

image

So I thought I'd try...

IE7 Emulation

Hitting the IE7 Emulation button on the toolbar actually annoyed me a little:

image

Couldn't this just emulate the tab...?

Anyway, I opened another IE window, emulated it and voila! The facebook warning disappeared. That's the extent of my testing this feature for today... :)

Other Niceties

The Developer Tools is built-in for some testing fun. I'm really looking forward to using it for sifting through page responses and comparing some of the IE7 and IE8 responses.

The "Are you sure you want to close all tabs" message that appears when you try to close IE with multiple tabs open has morphed to give you the option of just closing the current tab. I always thought a cancel button in these cases is silly because the big red cross in the top right and the Escape button are just as good.

image

The Address Bar changes how you look at the address of the current page by only making the domain name text black and the rest gray. I'm not sure whether this is for security or just usability, but I like it.

image

Comments

It's definitely RAM hungry. Only 5 tabs open and already 110MB in use...

image

It hasn't crashed in the last hour so that's good. :) I'm planning on just using it like IE7 and seeing how I go. I'll definitely keep posting about any oddities and niceties I come across.

Scott Hanselman posted about some cool Visual Studio themes so I thought I'd put mine out there.

image

As you can see, it's the simple white-on-black. It uses blue class names, purple strings, orange key words, and yellow highlighting. One of the things that some miss is the snippet fields. I've ensure that the fields are white on green and the dependant fields are green highlights.

I've been using this theme for quite a while now and am really enjoying it. It's a variation of something Paul Stovell gave me a while back.

It's available for download here. Give it a go and let me know what you think...

I was considering getting a KVM the other day, but stumbled across an open source application named Synergy.

It's a pretty nifty little app that lets you share a keyboard and mouse across two or more machines. This means that I can have my laptop sitting next to my desktop monitor and use the keyboard and mouse hooked up to my desktop to control the laptop.

The setup experience is the only hitch to this application. It's not totally user friendly, but it's not that hard to figure out.

Firstly, chose which machine will be the server and run the application on it. Choose the option "Share this computer's mouse and keyboard (server)" and click Configure.

image

Then, setup a screen for the server and the client machines by clicking the + button under the Screens list. This will give you a screen where you can type the names of the machines and modify the behaviour of the switch. It's probably best to leave the behaviour as standard at first and modify this later if required.

image

Now you should have (at least) two machine names in the screens list, it's time to setup the switching behaviour. Under the Links list, there are a couple of text boxes and drop downs. The easiest way to tackle these is to picture where your laptop screen is in relation to your desktop screen. My laptop is on the left of my desktop so I just selected "left" from the first drop down, then my desktop name, then my laptop name and pressed the + button. This means that when my mouse pointer goes over to the left edge of the desktop screen it will become my laptop's pointer.

clip_image001

I also need to setup the behaviour for how to go back to the desktop screen, so I just selected the opposite of what I had before.

image

Now I press OK to close the configuration screen and press start to start the server. If you haven't set it up properly you will get a crazy error message, so just close Synergy and start again. If you're running Vista (and/or a good firewall) you should be prompted that Synergy is trying to do something funny, so just let it. If you're running a firewall and you're not prompted, go to the firewall settings and make sure that Synergy is allowed to communicate.

Lastly, I need to connect my laptop to the server. I did this by opening Synergy on my laptop, which is a client machine, choosing the "Use another computer's shared keyboard and mouse (client)", and entering the name of my desktop (server) PC.

image

Now when I press start (and cross my fingers) the client connects to the server and I can freely use my two computers with the same keyboard and mouse while Synergy runs with an icon in the system tray.

That's it! It's simple was you get through the slightly cryptic UI, and it really works quite well.

Technorati Tags: ,

It seems to be a growing trend to decentralise your online services nowadays. In particular, everyone is moving away from these self-hosted environments and moving towards popular services such as Flickr and Wordpress, and Live Spaces.

I've only recently set up my own web site. When I started out, I decided using a content management system would be the easiest way to go. I then evaluated a few options and went with Community Server. However, I'm not really happy with CS (at least this version...) as a single user blog and web site platform. As an environment for communities it seems an excellent option, but it's just not for me.

One of the major reasons for this is photo management. It's just too complicated. And, it's not very user friendly for people who want to view them.

So, in an effort to move away from trusting CS with all my online content, I made the decision to use Flickr. I've had an account with them for a long while now, but when I realised that you can purchase a pro account with unlimited storage and bandwidth for under $50/yr I pulled out the credit card.

It wasn't until after I made my purchase I realised that Windows Live Photo Gallery has the option to publish photos directly to Flickr. Woot!

Publish on Flickr

You can find some of my precious memories at www.flickr.com/ducas. Over the next few weeks/months I'll be moving lots of my photos over.

Although, with Microsoft's recent bid to purchase Yahoo! it will be interesting to see what happens to this excellent service.

Technorati Tags:

Today was my first day presenting at RDN. It also marked my second and third user group presentations ever.

I can quite safely say that I am one of the least presented members of the Readify team, which is the main reason I took up the challenge of presenting at this level.

The Depth session was presented by Damian Edwards on CSS with ASP.NET using Visual Studio 2008. It was a really good session that gave me a great insight into CSS and hopefully will stop me from ever using tables again... :-)

My presentation was on SQL Server Integration Services, specifically in SQL Server 2008. The slide deck was not that intense and basically addressed the questions "What is SSIS?" and "What's different in SSIS 2005 and 2008?" It will be available soon on the RDN Downloads site.

In the meantime, I thought I'd put up a few links to the resources I used in preparing for this presentation.

As I mentioned tonight, I find the MSDN library help quite useless when it comes to developing SSIS packages. The SSIS Books Online site does have a couple of good intro and how-to topics.

For my demos, I used the November CTP of SQL 2008, which is available as a VHD from MSDN. This is a time-bombed installation of Windows Server 2003 with the SQL Server 2008 CTP pre-installed and set up with all the important features enabled, such as Reporting Services, Integration Services, etc.

For the "What's new..." I referred to MattM's blog. Specifically the excellent What's New in SQL Server 2008 Part One and Part Two summary posts. These link to a few other good write-ups as well.

Then there's CodePlex. The AdventureWorksDB and AdventureWorksBI sample database installations, along with the SQLServerSamplesIS SSIS samples are excellent resources.

For those new to SSIS and still living in the DTS world, all I can say is "what are you waiting for?!" :-)

For a little while now I've noticed my back pain has been getting worse and I think it's a result of leaning in close to my laptop to try get on eye level with it. So I bought one of these Alto Cordless gadgets on the weekend for my desk at work.

My overall opinion: it's swish, but I'm returning it.

Why, you may ask...? Especially after this photo:

Alto Cordless

Well it may look all funky and swish, and the USB ports may be really handy, but it just doesn't work. The first time I hooked it all up it did some wacky things. It would accept some key strokes, but not others. Then it would stick on a key. Then it would just stop working all together. It took me over an hour before I gave up pressing the connect button to pull out a USB keyboard. I at least wanted to use the stand...

Not long after I gave up, I discovered that the keyboard was magically working so I thought I'd keep it. Today, on my second day, I've decided that the dream is over. I went through the same pain this morning trying to reconnect the keyboard even though I left it plugged into the power overnight. When I gave up again and tried to plug in a USB keyboard, it didn't work. After punching a few keys I punched some keys on the wireless keyboard and it worked perfectly. Coincidence...? I think not.

Anyway, I think Logitech need to do some work to get this thing functioning and update their support site to say more than "this should just work with Vista".

Returning the set tomorrow to replace it with a $10 USB hub and a $20 stand.

I received this email from Boost Juice Bars today. Unfortunately, they're cutting off the 10% discount for Vibe members. Very sad news...

 

Logo-No-Oval - small.gif

Dear Very Important Boost Enthusiasts,

Over the last few years we have been fortunate enough to give our VIBE club members a 10% discount on our range of juices and smoothies.

Unfortunately due to the drought in Australia, the cost of making you the freshest juices and smoothies has gone up substantially, especially in the last 12 months; so much so that we have had to make a tough decision... either put our prices up, or keep them at the existing price and remove the 10% discount for VIBE members. We have chosen to remove the 10% VIBE discount, effective 1st February 2008. You can, however, still enjoy the benefits of the Boost loyalty stamp card (buy 10 and get the 11th free)

Our VIBE club remains with great monthly specials and exclusive offers to members, such as the VIBE Challenge and your free Birthday Boost. Should the drought break and the cost of our ingredients come back down, we will review the 10% discount again.

Thanks again for your loyalty to Boost, and for any feedback you would like to make regarding this please feel free to email me at [email removed].

Janine Allis

Founder

Technorati Tags: