Welcome to EMC Consulting Blogs Sign in | Join | Help

mister mann

every day is just a game of give and take... [ follow me on twitter: @mark_mann ]
AS OF OCTOBER 2011, THIS BLOG COLUMN IS NO LONGER ACTIVE
AND HAS MOVED, IN WHOLE, TO http://blog.mark-mann.co.uk

  • Silverlight UK User Group [October 2011] Agenda

    /BUILD/. Now wasn’t that a conference of suspense! Wow. Windows 8, redefining our interactions and embracing not just the traditional computer, but tablets and other touch devices too. I have not seen such a bold statement of intent since PDC2000 when Microsoft announced it’s plans for a revamp of it’s code/application subsystem - .NET!

    My tweet during Build Now there has been a lot of debate before, during and after /BUILD/ about Silverlight and WPF – people still seem to be looking for confirmation that these are dead technologies? I watched the keynotes and some of the sessions and quickly came to the conclusion – No.

    Sure, emphasis has been given to Windows 8 and the greater adoption of HTML5 but if you ignore the new Metro style features, Windows 8 is still a Windows operating system. This is borne out of the one of the two most frequently quoted slides from /BUILD/ – the Metro vs Desktop runtime slide (see below). There is still nothing stopping you from developing and deploying a WinForms, WPF or Silverlight application on Windows 8. If you want your application to take part within the Metro-style framework, then you’ll have to expend a little bit of effort converting it over to the WinRT framework.

    Windows 8  application frameworks

    Honestly, Silverlight 5 was made release candidate a couple months ago so there is still commitment from Microsoft that the Silverlight runtime and tooling will continue. Windows 8 is still in preview and while most people seem to be treating it as a solid, fully functional OS, it is not.. and won’t be till release! Things can and most probably will change before it’s shipped. Consider then, that most organisations who are currently upgrading from Windows XP/Vista can only jump to Windows 7 at the moment – plus a significant number of them won’t jump to Windows 8 straightaway. So, despite Windows 8 backward capability, many organisations will remain on Windows 7 till it runs out of Microsoft product support on it’s 10th birthday (or thereabouts) so dare I say, we’ll have about the same longevity in our Silverlight or WPF applications.

    I could go on, but I’ll save it for a Silverlight UK User Group night! I was not one of the fortunate people to attend /BUILD/ in person. Instead I had to watch the keynotes over the web - which gave some but not all the story or atmosphere of hype and anticipation. Thus I wanted someone who attended, to bring back and disseminate the knowledge of /BUILD/. Step in Derek Lakin from Pixel Lab. He’ll give us a round-up of the pertinent parts of /BUILD/ whether it was the keynotes, demos or the shiny new Samsung Windows 8 tablet that was given away as the free gift (or that the conference fee subsidised!).

     

    Date: Wednesday 12th October 2011
    Time: Registration @ 18:15, Kick off @18:30 – please don't be late! Till about 20:30
    Where: EMC Consulting 
    Notcutt House, 36 Southwark Bridge Road, London, SE1 9EU.


    Registration is required, so please register by sending us an
    email.

    Registered attendees will be notified with any final details by Monday 10th October. If you change your mind and decide on not coming, please be considerate of others and let us know in good time so that we can release the space to someone on the waiting list.

     

    AGENDA

    Registration @18:00

    Welcome/Kick off @ 18:30

    /BUILD/ Conference Roundup & First Hands On WinRT 
    with Derek Lakin from Pixel Lab

    Since Derek went to /BUILD/ who better to give a roundup of the conference… the hype, the buzz, the sessions, the demos… the free gift! Giving his own personal thoughts and opinions to the event, Derek hopes to impart some of the more important and lighter parts to the conference. Since Windows 8 played a large part of the announcements, Derek will also perform his own demo to show the re-purposing an existing Silverlight application (from his website) into a Windows 8 Metro application on WinRT using the preview.

    End. (officially the end, but no doubt we’ll find a nearby bar to continue any discussion!)

     

    About Derek Lakin

    Derek Lakin 

    Derek Lakin is the Senior User Experience Developer at Pixel Lab. He has been writing desktop and web-based client applications using the Microsoft technology stack for over a decade. He is a talented developer with the ability to deliver high quality visual and interactive experiences. He has co-written training courses on client technologies such as WPF and Silverlight for Microsoft product groups and Microsoft Learning. He currently maintains the blog Windows Phone From the Trenches.

    Derek Lakin's blog | Twitter: @dereklakin | LinkedIn Profile

    Many members of the Silverlight UK User Group are on Twitter, thus both myself and Michelle use it as our primary method of getting the relevant community or technology news out to the masses. So follow us if you like or take a look at the twitter hashtag we adopted, so that all the Silverlight UK User Group related stuff is neatly huddled together:

    Please register and I hope to see you there!

    mark.


      

     Want to join the discussion?
    The event is geared to please/interest/inform both developers and designers alike, so if you are interested in coming along then please contact us and we will be glad to add you to our events mailing list.

    Want to present or showcase?
    We are always on the lookout for presenters for future sessions - whether it be a high or low level coding walk through, a workflow perspective or showcase demo. If you think that you have a topic/presentation that ought to be shared with the community then please contact me and I'll see if I can get you scheduled in!

  • Silverlight UK User Group – Summer 2011 Update

    Crikey, it really has been 2 months since the Silverlight UK User Group (SLUGUK) last got together for an evening of Silverlight. I’ve always tried to get presenters and sessions lined up so that we can have a SLUGUK every 6-8 weeks… but they are proving a bit elusive at the moment. Coupled with the fact that we are undergoing flooring repairs at EMC’s Notcutt House this puts the diary under pressure with other hosted events competing for our favoured venue.

    In the 3 years that I’ve been organising SLUGUKs, I’ve had presenter droughts before, but this feels strangely different. I’ve gone round the houses a couple of times and finding fresh presenters is becoming tricky - it seems that the next wave of Silverlight innovators are overseas and getting them to the UK is not an easy task with no budget.  For those UK based Silverlight’ers, it’s not that everyone’s quiet… it’s more as if the market has evolved. When Silverlight made it’s foray’s into the bright world it was put to good use with delivering high quality video playback, data visualisation and immersive interfaces. While those capabilities are still Silverlight’s core strengths it seems that the advent of a new HTML5 / CSS3 world is encroaching upon that domain and pushing Silverlight (and WPF) into the world of finance and investment banking where consistency, security, and speed define the minimum requirements. This has produced an unexpected problem - getting willing demos of these reactive financial beasts is untenable due to the intellectual property amassed in these Silverlight applications. Damn.

    Microsoft Build ConferenceI suspect that another reason for the unusual quietness of the summer is that everyone interested in Silverlight, WPF, HTML5 and Windows is waiting in anticipation of the ‘Build Windows’ conference coming in September. Microsoft will be showcasing their progress on designing and building the next version of Windows -- Windows 8 -- which promises some radical rethinking and reengineering of the Windows Operating System we know of today. It is from the snippets of information from official sources and rumour that has led to many a story and comment about the future of Silverlight and WPF, since the  ‘Build Windows’ conference spends more time talking about HTML5, JavaScript and Internet Explorer 10 than the technology that underpins the SLUGUK.

    In 1995, Windows changed the PC. BUILD will show you that Windows 8 changes everything.

    I remain optimistic though. Indeed, Microsoft are promising a Windows 8 to redefine how we perceive and use computers, making much more use of multi-touch and cloud technologies, with a user interface that is ubiquitous across PC, tablet (slate) and phone. The website may announce a “new app model that allows you to create powerful new apps” and “web-connected and web-powered apps built using HTML5 and JavaScript have access to the power of the PC” but we are also promised “backwards compatibility”. I doubt that Silverlight will be relegated to the position of being only a  Windows Phone 7 application platform. I do hope that it is recognised that Silverlight does have a place in the web technology stack and on the on the desktop too -  maybe as some sort of WPF hybrid.

    Ordnance Survey getamap The reason for this optimism is that earlier this year, a project that I’ve been part of since it’s inception as the principal architecture authority came to fruition, and the Ordnance Survey getamap website was born to the public. There is only so much I can disclose, but it’s built in Silverlight using the Bing Maps Control, using services from Bing Maps and is a fully featured interactive mapping application (obviously). Silverlight proved to be the best technology for the job not only for the consumer experience, but also in driving down development/testing costs. I’m pretty chuffed at this accomplishment and you can read more in my blog post: "I made this - Ordnance Survey getamap". I’m also readying a brief technical tour of the project, hopefully for the next Bing Maps UK User Group.

    So, as the calendar turns over into September, I continue on my quest to bring some more Silverlight or WPF presenters/topics before you. If you know of someone who is itching to present at a SLUGUK or you’ve seen them on the user group circuit already or have a topic that you want to know more about, then please let me know. Suggestions are always welcomed and whenever possible, accommodated. Send an email to silverlight.usergroup@emc.com or add a comment to this blog post. If the speaker drought looks likely to continue through September, I’ll give a shout to a Silverlight Surgery so that there is a more social evening to get together and discuss the outcome of the ‘Build Windows’ conference.

  • AutoMapper Tip: DateTime and UseValue don’t mix

    I’ve been using AutoMapper on a number of projects for a number of years now and it’s always been a love/hate relationship. AutoMapper is a great  little .NET class library that takes the pain out of mapping one class to another but sometimes it makes me nervous when I just trust the magic and wonder what it’s really doing because although it hides the chore of reams of mapping code, is it also hiding mismappings? Just to prove this point, I discovered an innocent misuse of the AutoMapper configuration in my current project…..

    For some bizarre reason, the timestamp property on one of our C# classes seemed to be stuck in the past – across all instances it was the exactly the same time, rather than updating to the current time. The only place where the time was set, was in the following AutoMapper profile declaration:

     

    Mapper.CreateMap<LoginPostModel  , LoginAuditDetail>()
        .ForMember(dest => dest.OccurredAt, opt => opt.UseValue(DateTime.UtcNow));

    Reason is because, UseValue is a static, so it’s set once when the MapProfile is instantiated and all subsequent .Map invokes will use the same static value. Hence the sticky time value.

    Mapper.CreateMap<LoginPostModel  , LoginAuditDetail>()
        .ForMember(dest => dest.OccurredAt, opt => opt.MapFrom(src => DateTime.UtcNow));

    So when would you use UseValue ? Using a static value would be more applicable when setting up fixed Enums or custom values that are dependent on the mapping. For example:

    Mapper.CreateMap<Account  , CurrentAccount>()
        .ForMember(dest => dest.InterestCalculated, opt => opt.MapFrom(src => InterestCalculatedEnum.Daily));
    
    Mapper.CreateMap<Account  , SavingsAccount>()
        .ForMember(dest => dest.InterestCalculated, opt => opt.MapFrom(src => InterestCalculatedEnum.Monthly));
    
    Mapper.CreateMap<Account  , BondAccount>()
        .ForMember(dest => dest.InterestCalculated, opt => opt.MapFrom(src => InterestCalculatedEnum.Annual));
  • Silverlight UK User Group [June 2011] Slides

    Silverlight, WPF, Windows Phone 7 all from one codebase? Is it possible? Well, Colin Eberhardt gave us an hour worth of hints, tips and examples of how you can manage your XAML applications to fit these different software platforms. He’s an eager blogger, so his Colin Eberhardt's blog has many more WPF and Silverlight tips. Please remember to post any feedback about the evening on twitter using our hashtag #SLUGUK, and thanks for all that came along on the night.

    I normally give a shout out to the other user groups that are running events in the area, so here is an excerpt of those I put into my introductory slides at the start of the evening.

    Windows Phone 7 wpug.net  
    London .NET dnug.org.uk  
    Canary Wharf .NET meetup.com/cwdnug  
    Bing Maps bingmapsuk.ning.com June 30th
    F#unctional Londoners meetup.com/fsharplondon July 4th
    SharePoint UK suguk.org  
    UX Sketch Club meetup.com/ux-sketch-club  
    The Fantastic Tavern thefantastictavern.co.uk July 7th
    DevTank meetup.com/devtank  

    One of the best resources to look at or subscribe to is MSDN Flash.

    Slides: Silverlight UK User Group Introduction – by Mark Mann.

     

    Slides: Cross Platform XAML Applications – by Colin Eberhardt.

     

    With thanks to the cleanup crew that helped to put the EMC meeting rooms back in order --  Paul Stancer, Paul Lo, Mike Taulty (whom selflessly put chair-shifting duty before worrying about catching a train back to Manchester!), plus EMC Consulting for providing venue and beers.

    logo_emc_consulting

     


      

     Want to join the discussion?
    The event is geared to please/interest/inform both developers and designers alike, so if you are interested in coming along then please contact either myself or Michelle Flynn (here) and we will be glad to add you to our events mailing list.

    Want to present or showcase?
    We are always on the lookout for presenters for future sessions - whether it be a high or low level coding walk through, a workflow perspective or showcase demo. If you think that you have a topic/presentation that ought to be shared with the community then please contact me (here) and I'll see if I can get you scheduled in!

  • Silverlight UK User Group [June 2011] Agenda

    Since MIX11, tech.days.2011 and the AllThingsD conference (where we got a first peek at Windows 8), there’s been yet more mutterings as to the relationship between HTML5 and Silverlight. Shame that within the designer-development community there is still a wave of uncertainty as to the future direction of Silverlight and highlights a common nervousness to commit to one of these web technologies. You should not be nervous – embrace WPF, Silverlight, HTML depending on the problem or environment you are publishing to. As Mike Taulty (Microsoft DPE) stated at our last meeting: “Even now, we still have WinForms available as a core technology”.

    Our speaker for the next Silverlight UK User Group is well versed in the differences between WPF, Silverlight, HTML and (dare i say it) Flash in the world of business applications – Colin Eberhardt; who will focus on how to leverage your application to become cross-platform (with as little pain as possible!) and possibly mute those technology fears when you witness how transferable both codebase and experience really is. Colin is usually resident in Newcastle-upon-Tyne, so I’m pleased that he’s able to visit the south and can confirm the following agenda:

     

    Date: Wednesday 29th June 2011
    Time: Registration @ 18:15, Kick off @18:30 – please don't be late! Till about 20:30
    Where: EMC Consulting 
    Notcutt House, 36 Southwark Bridge Road, London, SE1 9EU.


    Registration is required, so please register by sending us an
    email.

    Registered attendees will be notified with any final details by Monday 27th June. If you change your mind and decide on not coming, please be considerate of others and let us know in good time so that we can release the space to someone on the waiting list.

     

    AGENDA

    Registration @18:00

    Welcome/Kick off @ 18:30

    WPF and Silverlight; Unifying the Development Platform for Desktop, Web and Mobile
    with Colin Eberhardt from Scott Logic Ltd

    The recent boom in mobile and tablet devices and the ubiquity of the web mean that we, as software developers, have found ourselves developing for a wide range of devices. All-to-often applications destined for the web, desktop and mobile are developed separately at great cost. This talk will look at how the XAML based technologies of WPF and Silverlight allow you to use your skills to build application for a wide range of platforms. Furthermore, with the use of simple design patterns, it is possible to share a common code-base for all three. In this talk I will cover the differences and similarities of WPF, Silverlight and Windows Phone 7, with a practical demonstration of cross-platform application development.

    End.

    About Colin Eberhardt

    Colin Eberhardt 

    Colin Eberhardt PhD BSc, Technical Architect, Scott Logic Ltd – Colin is a prolific technical author who writes on Microsoft .NET and Silverlight related topics.  Colin also provides technical direction for many of Scott Logic’s financial clients covering many technologies.

    Colin Eberhardt's blog | Twitter: @ColinEberhardt | LinkedIn Profile

    Many members of the Silverlight UK User Group are on Twitter, thus both myself and Michelle use it as our primary method of getting the relevant community or technology news out to the masses. So follow us if you like or take a look at the twitter hashtag we adopted, so that all the Silverlight UK User Group related stuff is neatly huddled together:

    Please register and I hope to see you there!

    mark.


      

     Want to join the discussion?
    The event is geared to please/interest/inform both developers and designers alike, so if you are interested in coming along then please contact us and we will be glad to add you to our events mailing list.

    Want to present or showcase?
    We are always on the lookout for presenters for future sessions - whether it be a high or low level coding walk through, a workflow perspective or showcase demo. If you think that you have a topic/presentation that ought to be shared with the community then please contact me and I'll see if I can get you scheduled in!

  • Virtual Hard Disk (VHD) Management

    This should hopefully be, the final part of what has turned out to be a three part series documenting my thoughts on managing my laptop’s disk resources. It all started when I swapped my old laptop hard disk for a superb 500GB Seagate Momentus XT Solid State Hybrid Drive to help alleviate my disk space woes last year and then started experimenting with virtual hard disks (VHDs). Initially everything was fine but it’s taken me a while to fine-tune and accommodate a couple of new considerations posed by VHDs. This post formalises what I’ve (finally?) settled upon, so that I can manage my various laptop OS/working configurations to give me the best flexibility for the future.

    Part one of this (unintentional) series, was about moving my working environment to a new disk with minimum of fuss [You can read that post here:How to turn a physical disk into a bootable VHD”]. This proved a highly successful experiment, enabling me to copy my existing laptop configuration to a VHD and then be able to dual boot into the rebuilt configuration (native partition – native operating system) or run my old configuration through a contained VHD directly on the laptop hardware (no need for VMWare or Virtual PC). This was achieved with little downtime and also provided an unexpected backup strategy too. However, even though I had transferred and converted my old configuration into a single VHD file (see diagram below) it had not actually solved any long term space issues - the original partitions still remained practically the same size and were pretty much bursting (forcing me into strange backup procedures to ease the discomfort – see my post “Windows Phone 7 Backups - Release more space”].

     Blog post 1 got me to here . A bootable VHD residing on the physical disk.

    Part two talked about how to extend or shrink a VHD using Windows 7 [You can read that post here:Resizing Virtual Hard Disks (VHDs)”].  By making good use of the various actions available in Windows 7 Disk Management, I managed to reconfigure my VHD layout -- to a point where I got stuck at a dead end. In my eagerness I thought I could just reduce one partition and expand the other and forgot the most basic rule of partitioning…

    “a partition needs to be one contiguous block, regardless of the disk drive being physical or virtual”

    Damn. I had remembered the hard way, that although I had made space by reducing the excess of my Data partition, the free space was in the wrong position to extend my nearly full OS partition (see diagram below).

     Blog post got as far as here. Wasted unallocated space on the bootable VHD.

    So now I’ve had a bit of time to take stock of the situation, experiment a bit further and unravel the sequence of getting my partitions to the desired sizes. While this notion of cloning to VHD is a feasible option it does come with a couple of restrictions that may alter your course of action:

    1. Mounting a cloned VHD within the originating VHD is not possible – it’s a bit like a Star Trek time paradox. The cloned VHD will have the same logical disk identifier (which is embedded within the disk identification metadata) as the parent it came from. So even trying to mount one inside the other will cause a clash of IDs for which, Windows will prevent. This harks back to the time when physical disks ruled and were copied rather than cloned.
    2. VHDs are actually limited to 128GB in VMWare or Virtual PC. I did not expect this one, but it’s true. I’ve survived with a 155GB VHD only because I use it as a bootable VHD direct from a native Windows instance as explained in my previous post “How to turn a physical disk into a bootable VHD”.
    3. Running the cloned VHD within an instance of VMWare or Virtual PC with the originating drive running as host. Paradox time again, you’ll bump into the issue of logical disk identifiers again (as explained above) and doubly unlucky if over the 128GB limit (as explained above).
    4. VHDs are only guaranteed to be mounted and ready if you boot from them. Unfortunately, Windows does not remember what extra VHDs you attached and does not remount them after the Windows start-up sequence has completed. So, in the adjacent diagram, splitting my one large VHD file into two separate VHDs (so that I can expand or shrink the partitions independently)Impracticable - splitting to separate VHDs means one will not remount automatically on reboot. the first VHD file will always be available because it’s what I boot from. The second VHD will have to be remounted each time (hence the big red cross). You can script this, so that Windows remounts this automatically, but I moved my profile and other various files to the second partition, so scripting is not good enough since Windows might need files from this VHD before it is mounted.


    5. Reverse the procedure and go “VHD to disk” ??? – unfortunately this is not possible. Moving from either a fixed size or dynamic VHD back to a physical disk’s partition set is not possible. There are no native tools available (Disk2VHD does not go backwards!). There are a number of other backup tools that perform this action, but this is not actually a backup scenario in itself so I won’t count them as an option.

     

    Disk management can be like a slider puzzle.In fact it feels like I’m playing one of those tile sliding puzzles, juggling disk resources about, trying to mount this VHD, that VHD, rebooting into a new native OS and so on. So, having stepped back for a bit more thought I reverted back to first principles of disk management as if I was swapping physical drives rather than virtualised ones. So, to recap the problem, I need to reduce my cloned VHD to a more sensible 120GB (under the 128GB limit) and expand the C:\ logical partition upon that VHD. The following steps are how I overcame this bearing in mind the above restrictions….

     

    Firstly, defrag, defrag, defrag! Remember i mentioned contiguous space for partitions? Well the same can be said within partitions; if there is any disk/partition resizing to be done, it’s best done with all the files pushed into one contiguous block. There are a number of disk tools that can do this but not all work well or at all with VHDs. So I would recommend using Auslogics Disk Defrag (free for home use) and running the tool with the “Defrag & Optimize” option which help reorder the files on disk.

     Auslogics Defrag & Optimise option

    Once satisfied with the system being as optimally ordered as possible, the next step is to offload the “blocking” partition. The second partition was emptied over to another disk, preferably a local physical disk – not another VHD or network location because that would take too long. I can reply on a basic file copy for this partition because its only a data; there is no boot sector here. Also, when copying the files away from the source, forget about using Windows Explorer’s drag and drop since it seems a lot slower and only copies what you see (unless you have reconfigured the settings for hidden and system files). I would recommend using the command prompt’s XCOPY command with the options to copy all hidden/system files/folders as required. The larger the amount of data the longer it will take, so probably left best to cook overnight!

     Making room. Backup the second partition to local disk elsewhere!

    Now the data partition is safely backed up, I want to delete my second partition so that it it will present the minimum amount of hassle with resizing my VHD in the next step. If I did not, I would have to reduce the last partition to a suitable size that allows the overall disk to shrink further. When shrinking a partition, its more complicated because the shrinking process is limited to working with unallocated disk – hence my suggestions to defrag and optimise the disk beforehand. Since my OS partition is well below my intended 100GB VHD target, removing the Data partition enables me to resize with impunity. Windows 7 comes with a decent set of inbuilt disk tools (as I mentioned in “Resizing Virtual Hard Disks (VHDs)”) to allow you to extend, shrink and delete partitions (Volumes). Just type “Disk Man” in the search box from the Windows Start menu and select “Create and format hard disk partitions” – the Disk Management Console will look a bit like the next diagram.

       The Windows Disk Management console.

    Having deleted the second partition, shrinking the VHD will be much quicker. Reboot into a Windows OS instance that is not run from the VHD and ensure that the VHD is un-mounted – if not already. Run VHD Resizer (its’ an old tool with a very basic UI but it does the trick) selecting the VHD to shrink and the destination for the new VHD (it does not alter the original). You’ll note that when you select the source VHD, VHD Resizer will think for a while – basically it is analysing the source VHD to determine what is the maximum amount of shrinkage that can be allowed. Type the new size desired (100GB here) and ensure that the “Type” dropdown is “Fixed” because in this case my VHD is a Hyper-V/bootable VHD and they only work with fixed sized VHDs! If you have space, use a local destination (another partition, drive or USB hard disk) because the tool will want to create a 100GB file and that’s quite slow over a network. Be prepared, this process will take some time to complete.

    Removing unwanted partitions makes VHD shrinking a lot easier.

    The VHD should now be a neat 100GB and still with lots of free space because the second partition was previously deleted to allow a a contiguous extension. I need to bump the size of up my OS partition now, so by using the in built Windows 7 disk tools (see previously) it’s simply a case of right-clicking my partition and selecting “Extend Volume” (I won’t take you through the wizard steps because its really easy to figure out). I’m being selective about what I put back onto my second partition, so I’ve planned a 60GB/40GB partition split.

    Expanding the primary partition (finally!).

    It does not take long to expand a partition (given some free contiguous space), so once that is completed use the Disk Management tools to “Create Volume” in the remaining unallocated space. Windows will automatically format and assign a drive letter; if the drive letter is changed a reboot will be required. Since the two partitions reside on the same VHD, they will both be available if you boot from that VHD.

    Now copy whatever data is required from the second partition backup back to the new partition. As before, use the command line XCOPY to transfer the files across since it’s faster. When this all finished, I swapped the new 100GB VHD for the old 155GB VHD being careful in my renaming. The new VHD is essentially a smaller clone, so the boot sequence is none the wiser that the VHD size has dropped.

    Nearly there, restoring the data files back to the VHD. 

    Neat and tidy. Feels like I've done the Rubik's Cube 1000 times over.

    In Conclusion:
    Well gosh, this has been a road of rediscovery but I’m glad that I’ve done it. The fundamentals of disk management are not that much different between physical disks and VHDs but there are some gotchas to plan around. These have not curbed my enthusiasm for bootable VHDs since it’s still an excellent to maintain separate bootable environments from one PC without having to resort to dedicated dual boot allocations and locking down to that PC. I use my native operating system for general everyday computing and a bootable VHD for whatever client project/environment I need to at that time. As the environment gets old or the project finishes, the VHD can be archived and a fresh one created in it’s place. Neat.

    It’s not every day, month or even 6 months that I need to go through all this juggling – only because this VHD was a mega workhorse of an environment, namely my old laptop operating system configuration! Keeping more than one bootable VHD on my PC has taught me other tip though; keep your local data to a minimum. If you don’t look at a folder or file in over a month, then archive it and don’t make it part of the project VHD, keep it native to disk and let the VHDs dip into it. This is how I ended up with a smaller second partition on the VHD because my ratio flipped from 30/70 to 60/40 operating system to data.

    I think that as I finish writing this blog post (of three) this is much less about following a set of steps to manage your system but more of a brain dump of the obstacles that I faced that you may not have appreciated till now. Believe me, hitting a dead end after waiting 14hrs or so for a series of partition operations to complete is not fun! Hopefully I have spared you (some of) that frustration.

  • Silverlight UK User Group [May 2011] Slides and Video

    We were packed out at Notcutt House for May’s Silverlight UK User Group. Excellent to see that there is a lot of interest and passion still buzzing about for Silverlight. Mike Taulty was our sole guest speaker of the night and relished the extra time to go into the depths of the new features of Silverlight 5 (beta). Unfortunately Chris Arnold was called away at last moment and could not give us an update on the imminent release of PivotViewer v2 – however I’ve got him in my sights to do a full slot in the future, rather than just an update.

    Here is another reminder that the big week long event is happening next week: Tech.Days.2011. If you have not already taken a look, there are plenty of great sessions (both speakers and content) at this mini-conference. There may be some seats still available for various sessions but much of it will be recorded too.

    Tech.Days.2011

    I normally give a shout out to the other user groups that are running events in the area, so here is an excerpt of those I put into my introductory slides at the start of the evening.

    Windows Phone 7

    May 24-25th

    wpug.net
    London .NET

    May 31st

    dnug.org.uk
    Canary Wharf .NET

    June 1st

    meetup.com/cwdnug
    SharePoint UK

    June 1st

    suguk.org
    UX Sketch Club

    June 8th

    meetup.com/ux-sketch-club
    The Fantastic Tavern

    tba

    thefantastictavern.co.uk
    Bing Maps

    tba

    bingmapsuk.ning.com

    One of the best resources to look at or subscribe to is MSDN Flash.

    Slides: Silverlight UK User Group Introduction – by Mark Mann.

     

    Slides: Silverlight 5: the beta and beyond – by Mike Taulty.

     

    VIDEO PLACEHOLDER – 30th May

    The event was recorded, however our cameraman is temporarily overseas which has made post-production editing and downloading a bit tricky. Hopefully we’ll have the video ready on his return and I’ll update this page.

     

    With thanks to Ian Smith (irascian) for recording the event and EMC Consulting for providing venue and beers.

    irascian      EMC Consulting

     


      

     Want to join the discussion?
    The event is geared to please/interest/inform both developers and designers alike, so if you are interested in coming along then please contact either myself or Michelle Flynn (here) and we will be glad to add you to our events mailing list.

    Want to present or showcase?
    We are always on the lookout for presenters for future sessions - whether it be a high or low level coding walk through, a workflow perspective or showcase demo. If you think that you have a topic/presentation that ought to be shared with the community then please contact me (here) and I'll see if I can get you scheduled in!

  • Resizing Virtual Hard Disks (VHDs)

    This is part two of my journey into managing my laptop’s disk resources. Part one, was about moving my working environment to a new disk with minimum of fuss [You can read that post here:How to turn a physical disk into a bootable VHD”].

    Disk management is one of those things that is never on interest until it’s really too late – when you are running low on space on your computer. With a bit of planning you can figure out a way to make best use of existing hardware or buy some more, but there is always something you never think of which makes you want to tinker more. I upgraded a 160GB hard drive for a superb 500GB Seagate Momentus XT Solid State Hybrid Drive to help alleviate my disk space woes and on discovering the excellent level of support that Windows 7 provides for virtual hard disks (VHDs), it made good sense to use this to minimise the downtime of moving disks.

    Running low on space (again) So despite increasing my disk storage, moving to a system of running and backing up to VHDs I’m still desperately low of space on my Windows 7 system partition. I guess that when I finished juggling all my disks and files about, I naturally thought “job done” and that I would not have to revisit this particular issue for a while later. Windows of course, knew the real truth and decided to remind me how dangerously close to the edge I was getting by continuously popping up “low disk space” notifications.

    Only 59MB free after Disk CleanupNot only do my running applications continuously compete for resources but it’s even pervading where application data is stored – for example; I recently wrote about trying to work around where Windows Phone 7 backups are stored, because my system drive could not cope. I could only manage a week of constantly running the  “Disk Cleanup” tool and scanning my system drive for any obvious candidates of deletion, but it’s pretty dire when despite these efforts you only end up with 59MB! Clearly, I need another strategy.

    Now, all this turmoil is occurring on the system partition of the bootable VHD that I created in my previous post [You can read that post here:How to turn a physical disk into a bootable VHD”]. The techniques I’m about to show you has origins with physical disks too, however having baked my own VHD file it’s more relevant to VHD management.

    When Windows 7 is running from a bootable VHD it has mounted the guts of a disk image file that is sitting on a physical partition on the machine. My VHD is big enough at 156GB and it holds two virtual partitions (one is the system, the other data). Normally, it’s just a case of resizing partitions, but how does that work with VHDs? Thankfully Windows 7 does not treat VHDs any differently to physical disks and therefore this can be managed using the inbuilt disk management tools.

    So, from the “Start” taskbar, search for “Disk Management” or “Create and format hard disk partitions”. This will pull up the following control panel with details of your current system. Be careful with any of these options!

    Disk Management view of the VHD

    Partition Options in Disk ManagementSo, with my booted system partition languishing with only 169MB, I thought that I could shrink the larger DATA partition and reallocate this to the WIN7 partition. Shrinking can be performed on any partition, basically so long as it has some free space (there are a couple more rules but the computer checks these for you later).

    The Disk Management console is pretty neat, in that if any of the options are not available, it will just disable the context menu options. Here, “Shrink Volume” is available on the DATA partition of my VHD, thus by clicking it, the console will spend a number of minutes analysing the partition.

    Shrinking options on my VHD partitionThe pre-shrink checker reported to me that my drive is sufficiently bare to reduce my partition by 29GB. Note that this can depend upon where your data is stored on the disk itself, that is, shrinking considers data in roughly one contiguous group, so if there are system files scattered throughout your partition, this reduces the potential for the shrink operation hence why it’s not recommending all 34GB of free space.

    I just want to free up some space, not all, so I’m liberating 12GB from my DATA partition that I’ll use on my system partition. Kicking off the shrink process involved leaving he laptop uninterrupted for 3 hours, best let it do it’s shrinking business alone.

    On re-examining the Disk Management console, I’ve now got a 11.72GB unallocated partition on my VHD. It’s at this point I’ve realised a fundamental flaw in my plan. Although I’ve released this space, my VHD represents one piece of disk media and the unallocated space is in the wrong position! Quite simply, when you have split partitions on a physical disk they sit back-to-back and the same applies to virtual hard disks (VHDs) too. The console view demonstrates this very simply that my system partition (WIN7) can’t be extended because the DATA partition is in the way (shown by the red arrow stopping abruptly whereas the green arrow can reach across). This is why the “Extend Volume” option is only available to my DATA partition and not my WIN7 partition.

    Post shrink - created unallocated space

    With good intentions, this has not really helped solve anything though, except trim some dead space off my partition but the VHD remains unchanged as a whole. Remember that a VHD is a virtual representation of a physical hard disk; it still takes up disk space on the physical medium, albeit as one massive file rather than natively scattered over the drive. My VHD has not decreased in size unless I actually want to trim it, from which I have a couple of options…

    Normally I’ll use GParted Live to manage my native disks/partitions since this boots from CD and because it is not running the native OS directly, it can shift and reorder any files that it sees fit (well, within reason!). I would thoroughly recommend GParted Live as it’s never let me down (famous last words) but I don’t think that I’m able to do the same here though because GParted Live uses a Linux Live Kernel which does not know how to mount VHDs as a live partition (wail).

    Unsurprisingly, there is a tool called VHD Resizer, which is despite it’s age has established itself as a simple but robust tool to change a VHD file. There is the option to resize the VHD or change it’s type to/from fixed or dynamic sizing. It performs a sector by sector copy operation from one VHD to a new VHD and although I have not used this tool in this instance, it would appear to release or grow the tail end of the VHD – best in this case to resize my VHD just a bit bigger than 40.05GB + 103.44GB so that most of the unallocated space is chopped off. The one disadvantage of VHD Resizer is that it cannot be run from a Windows instance that is running – I would have to log onto my native Windows installation and run VHD Resizer against the inactive VHD file.

    The last option I considered and for which I am the most gutted about since it does not work would be to do what I did before when creating the VHD in the first place and use the Disk2VHD tool! Hoping that Disk2VHD could reliably clone the selected partitions to separate and expanded VHDs, the clue was in the name, it’s not VHD2VHD. Unfortunately, the tool detects only native drives and converts those into new VHDs rather being duped into thinking that the host VHD is a native drive.

    [You can read more about how I originally used Disk2VHD in the post here:How to turn a physical disk into a bootable VHD”].

    Time for a rethink of how I’m going to get more space for my system partition - which is the real threat for grinding to a complete halt. I have a couple of ideas and I’ll report back once I’ve seen if they’ll do the job. At least you’ve seen how easy it is to shrink or expand those VHD partitions using the inbuilt Disk Management tool.

  • Silverlight UK User Group [May 2011] Agenda

    So, with Silverlight’s main conference of interest over, what did you make of MIX11? Sure, Silverlight was pretty poorly mentioned in the two keynotes as HTML5, Internet Explorer 10 and Windows Phone 7 stole much of the limelight, BUT there was still plenty of breakout sessions that featured Silverlight 4 and beyond.

    MIX11 website If you weren’t lucky enough to go, don’t despair! All the sessions were recorded and are available for download or streaming at your own leisure [http://live.visitmix.com/mix11]. Quite a few downloaded videos have made it onto my Windows Phone 7 handset to make my train journeys a bit more productive!

    tech.days.2011 website Back here in the UK, the tech.days.2011 week is fast approaching (23rd-27th May for London). This week of events is definitely worth a visit, with a strong line up of speakers and interesting subjects in the realms of Mobile, Client, Cloud, Web, Desktop and Server (so the slogan says!). You don’t have to attend all the days, in fact registration is for a day-at-a-time and for a particular stream. Again, don’t think you’ve missed out by not going in person, many of the sessions will be recorded.

     

    Both these two events have something in common with the speaker at the May Silverlight UK User Group… Mike Taulty. Mike paired up with John Papa at MIX11 to host the pre-conference Silverlight BootCamp. Mike is also speaking at the forthcoming tech.days.2011 on Silverlight, which means that he’ll have some pretty relevant things to say about Silverlight 5 (beta). So, I’m very pleased to confirm the following agenda:

     

    WOW. Due to unprecedented demand this event is full!
    There is a rapidly growing waiting list, so you can still register an interest. For those that got in early, please be considerate and tell us if you can't make it so that we can reallocate a seat in advance. Thanks.

     

    Date: Wednesday 18th May 2011
    Time: Registration @ 18:15, Kick off @18:30 – please don't be late! Till about 20:30
    Where: EMC Consulting 
    Notcutt House, 36 Southwark Bridge Road, London, SE1 9EU.


    Registration is required, so please register by sending us an
    email.

    Registered attendees will be notified with any final details by Monday 16th May.

     

    AGENDA

    Registration @18:00

    Welcome/Kick off @ 18:30

    Silverlight 5 – the beta and beyond
    with Mike Taulty from Microsoft
    [about 60-80mins]

    The Silverlight 5 beta was released just last month at the MIX 11 conference in Las Vegas and makes significant advances in various areas like graphics, media, data and in the application model allowing new scenarios that are either impossible or difficult today in Silverlight 4. In this session we’ll take a look at what’s present in the beta, poke around in some demos to figure out how things work and we’ll also talk about features that are not in the beta but will be coming before release later this year.

    Inside PivotViewer v2 – a update
    with Chris Arnold from PhotoPivot
    [about 20mins]

    In this short talk I'll be looking at the new Data Binding features of PivotViewer v2. We'll see how to transition your old data bound lists to a more richer control and introduce some new Collection classes. We'll also take a quick look at how CustomActions have grown up in this version.

    End.

     

    About Mike Taulty

    Mike Taulty 

    Mike Taulty works in the Developer and Platform Group at Microsoft in the UK where he has spent the past few years helping developers understand and get the best from the Microsoft platform. Prior to this, Mike spent 3 years with Microsoft Consulting Services as a consultant on developer technologies.

    Before joining Microsoft, Mike spent the previous 9 years working as a software developer for a number of enterprises, consultancies and software vendors working with a variety of operating system, client, communication and server technologies.

    Blog: mtaulty.com | Twitter: @mtaulty | LinkedIn Profile

     

    About Chris Arnold

    Chris Arnold 

    Chris Arnold is a parallel entrepreneur, lean startup fanatic and full-stack engineer. He is the founder or co-founder of a number of startups that all utilise PivotViewer. Prior to this Chris was the CTO of a Financial Services Software Company. On discovering Live Labs Pivot he wrote http://tweetpivot.com and pitched the concept at BizSpark Summit 2010. He is now using PivotViewer as a cornerstone in creating successful, high-growth businesses.

    Blog: goodcoffeegoodcode.blogspot.com | Twitter: @GoodCoffeeCode | AboutMe Profile

     

    Most of our user group are Twitter’ers, so if there’s anything you want to share amongst the group, then check out our Twitter accounts or our user group hashtag:

    @mark_mann

    Mark

    #sluguk 


    sluguk

    @michelleflynn

    Michelle

    Please register and I hope to see you there!

    mark.


      

     Want to join the discussion?
    The event is geared to please/interest/inform both developers and designers alike, so if you are interested in coming along then please contact us and we will be glad to add you to our events mailing list.

    Want to present or showcase?
    We are always on the lookout for presenters for future sessions - whether it be a high or low level coding walk through, a workflow perspective or showcase demo. If you think that you have a topic/presentation that ought to be shared with the community then please contact me and I'll see if I can get you scheduled in!

  • Windows Phone 7 Backups - Release more space!

    Soon after I installed the Windows Phone 7 ‘NoDo’ update (see my previous post), another update pops up. This time, instead of a functionality update, this one is more concerned with replacing some fraudulent web certificates (more details here).

    WP7 Certificate update prompt.

    Sounds like a good idea. However, before the update process can get into gear it abruptly stops with a disk space related problem. Those of you that have been following my blog will know that I’ve been going through space issues of late (see “How to turn a physical disk to a bootable VHD”) and so my laptop is creaking at the seams (only through my own laziness).

    WP7 update error on backup 

    This time, to install this update I’m going to have to free 1.1GB on my C:\ drive. What happens on the next one? (the current expectation is that Windows Phone 7 settings in Zunethere is a bigger, functional update being crafted together by Microsoft called the “mango update”). With the minimum memory  specification for Windows Phone 7 set at 6GB it would appear that I could be asked for another 6GB on the next backup and my C:\ drive will surely groan, however can’t I push these backups onto my other logical “data” disk?

    The logical place to look at first is at the Zune software which handles all the syncing of data between your computer and the phone device. I know that there are a good number of settings to help configure the music and video library, plus temporary folders where conversion files end up, however there is no sign any setting that allows control of backups.

    I’ve also done a search of the registry hunting down the Windows Phone 7 and Zune registry keys for a hint of the directory. Nevertheless there’s nothing of interest there. (Note: if you’re not old enough to know about the registry, then leave it alone playing about in there without confidence is lead you to disaster).

     

    After a bit of head scratching, one of my disk analysis tools came up trumps and I discovered the following folder:

    Windows Phone 7 backup folder

    Of course, this folder existed since I had to perform a phone backup as I installed the “NoDo” update a couple weeks ago (see my previous post). As you can see, it’s in my AppData folder which is governed by the operating system as part of the profile store. Sigh, that means that I have to do some substantial reconfiguration of my Windows 7 instance to remap my AppData folder to a disk with ample space. I don’t want to do this.

    Thus, I’ve resorted to an old trick that I used to play when configuring servers with small disk partitions in the late 90’s. Before I divulge this tip, let me warn you:

    NOTE: I don’t assume any responsibility for your backups or stability of the system. It’s your computer and your choice if you follow the guidance below. The old adage that it works on my machine is not a guarantee that it works on yours!

    Swap out folders – basically take a copy of the files, park them up somewhere else and label it up so you don’t forget. If you need to restore the backup later, then just move the files back as you need them! Thus:

    1. Locate the folder C:\Users\<your username>\AppData\Local\Microsoft\Windows Phone Update
    2. Copy the folders within, to a different drive and backup folder of your choice.
    3. Delete the contents of each sub-folder of the Windows Phone Update folder. By leaving empty patch directories, you’ll have a chance at remembering what goes where if you need to restore later.
    4. Create a shortcut to the backup folder and put it in your Windows Phone Update folder. Rename this shortcut as “Windows Phone Update – Backup Location” (easier if you have two windows explorer windows open).
    5. Create a shortcut to the Windows Phone Update folder and put it in your backup folder. Rename this shortcut as “Windows Phone Update - Original Location” (easier if you have two windows explorer windows open).

    Therefore, you should end up with something like this:

    Windows Phone 7 moved backups

    If you ever did need to revert back to a particular backup set, it’s easy enough to copy the folder to the destination at the end of the shortcut! Voila!

    A couple of other pointers to make your backups a bit lighter:

    • Most Windows Phone backups are full device backups, thus all the internal operating system, settings and content is copied off the device. Depending on your usage, (and mine has been making good use of the video playback on my HD7’s big screen) regularly discarding unwanted videos, music or games does help reduce the amount of data to backup.
    • Backups can be placed on any drive you like, but if it is a Windows formatted disk, make use of the folder compression options. Granted, that the compression rate may be pretty low because a Windows Phone 7 backup consists of a lot of 4MB binary files, but this is still best practice and may squeeze you a bit more room. So, right click the folder and click the Advanced button on the General tab. Ensure that the “Compress contents to save disk space” is ticked.

    Folder compress

     

    I hope you found this useful. It’s certainly allowed my disk to breathe until the next phone update!

Powered by Community Server (Personal Edition), by Telligent Systems