Losing Weight with Fitbit & HealthVault

In early March, I visited the doctor after days of headaches. While nothing was found, he was unhappy with my blood pressure and weight. Should nothing change soon, blood pressure medication would be in my future.

This is how I discovered that my weighing scale was broken and I was 13kg heavier than I had previously believed. It was time to purchase a replacement scale and some kind of exercise tracking device.

So after several days of comparing fitness monitoring products from companies like Garmin, Jawbone, & Withings, I settled on a Fitbit Flex wristband & Fitbit Aria wifi-aware weighing scales which were both compatible with my Microsoft ecosystem (Lumia phone & Surface) and my wife’s iOS equivalents. If one has a modern smartphone with MobileTrack compatibility (such as the Lumia 640 or iPhone 5S) then the Fitbit software does not require a Fitbit device. However, the metrics are better when combined with one.

Losing weight is simple logic – eat less & exercise more. The Fitbit Flex automatically tracks my walking, hiking, or running exercise (& climbing in other models if, unlike me, you live or work in multi-storey buildings or in the mountains). On the other side of the equation, it also provides the facility to log your food intake. Finally, the Aria automatically updates my weight & body fat each time I step on it (and it does recognise different family members).

The Fitbit app allows you to set a goal & select how aggressively you wish to pursue it,  providing four plans  with their daily calorie impact – Easy – 250 , Medium – 500 , Hard – 750 , or Harder – 1,000. You can also create a custom setting. In my case, my doctor’s goal was to lose 18kg in just under 3 months & I needed to pursue the Hardest plan to meet this.

Over the last couple of months, my regime has settled toward eating 2,000 calories and burning 3,500 each day. The burn is achieved by walking more than 11km daily through a combination of 3km walks and Fitbit recommended hourly “250 step” breaks from desk-work. This gave me a 1,500 calorie deficit and an average 0.2kg daily weight loss. And it still allowed me to sneak some chocolate into the program. I learned that doing nothing, I consumed 1.5 calories per minute but walking increased this to 10 calories or more per minute.

So how did it work out over the last 4 months? I have dropped 22.4kg (49 lbs or 3.5 stone) so far. Blood pressure is down from 140/100 to a more reasonable 119/85 yesterday — dropping from regular Stage 1 Hypertension to alternating Normal & High-Normal.

As one gets lighter, it does get harder; all the quick wins come early. I lost 4kg (9lbs) in the first week alone but I was unable to lose 4kg in the 4th month. As one loses weight, one burns less calories just being alive.  In the beginning, I would walk around 8km (5 miles) per day but now I need to walk at least 11km to achieve the same burn rate. This takes 2 hours per day so I may have to switch to more intense activities such as running, cycling, or a return to Aikido to burn more calories in less time. Alternatively, I can simply choose to eat less.

I do feel fitter and my pace is much faster; before, my wife had to slow down on hill climbs to let me catch up whereas now she has to concentrate on keeping up. Father’s day was spent replacing 42″ (107cm) jeans with 38″ (96.5cm) and many belts have been retired. The headaches are gone.

My dog needed and benefited from this regime too; she lost 2kg in the same period despite having the appetite of a small horse. Be warned, the dog slows you down. We learned to retrace a route as she was less distracted on the second lap.

Fitbit does not track Blood Pressure but the Fitbit app does interact with many third party products. I used Microsoft HealthVault for tracking medication and other measurements such as Blood Pressure. Fitbit can be configured to push activity, diet, and weight measurements across to HealthVault.

Finally, I am no cook and diet does play an important role and I definitely benefited from marriage to an expert diet chef who found subtle ways of replacing many foods with more healthy equivalents. Some important changes for me were no added sugar or salt, more fruit, & much more fibre. But, sometimes, the most important decision of the day was choosing to spend the last 70 calories on a Whiskey shot or a digestive biscuit!

So this next section is the view from the the perspective of Alison, my personal Diet Chef ….

So Niall loves food period. He is a wonderful husband for a chef to have. He doesn’t mind if he gets beans on toast or I’m trying out some weird recipes with loads of herbs and spices and he never complains that I don’t like peppers and things he loves.

Niall had a mission. I don’t believe in ‘low fat’ this and am really anti sugar free artificial sweeteners. I believe in real food. The kind that grows and isn’t artificially created. It does not have to be organic it’s great but not necessary, and it can be frozen and it can be fast. Life is fast paced and usually food has to be too. In short what I did was use lean meats, lots of veg in the forms of veg with dinner and soups and in salads. White bread was not totally excluded but more often replaced with whole meal Irish soda bread. Breakfast was muesli or other wholegrain cereal and Niall ate a lot of fruits. Orange juice was often squeezed fresh at home.

Herbs are the most underrated things to liven up boring foods- fresh herbs that is. Processed foods went out the window. There simply were no pizza nights. We discovered the if we broke out and went for a mixed grill of sausages and rashers, we paid for it – we had to walk off calories for days, they just seem to stick around unwanted. Fish is fantastic – it is really low in calories but expensive to buy. Eating out usually had consequences because you can’t control what goes into your food quite as well as making it yourself.

No one ever went hungry. No one felt they were denied anything, but by knowing how many calories you had eaten and how many you had burned during the day you could decide what and how much extra you could have and knowing the data helped control if you would have a glass of wine or some ice cream or both.

Note 1kg = 2.2 lbs , 1st = 14 lbs , 10km = 6.25 miles
1 lb = 3500 calories , 1 kg = 7716 calories
Phones with MobileTrack compatibility – https://www.fitbit.com/eu/devices

Experiences with Microsoft Surface Pro 4

A few months back, GSM Connections had incredible offers on the Surface Pro 4 (& still do – the m3 @ €799 & i5 @ €899) with a black or blue Type keyboard included free – https://www.gsmconnection.eu/collections/smart-phones/products/microsoft-surface-pro-4-128gb-intel-core-i5 . I was looking for offers on this latest Surface Pro model for both my eldest son and myself.

The first difficulty was choosing between the fan-less m3 and the more powerful i5. Eventually, both of us chose the m3 over the i5 to have something more like an iPad rather than a PC. Both of us have other workhorse machines for heavy-duty work and we wanted something could be taken everywhere and use anytime.

However, there were a number of important lessons along the way.


Before doing anything else, CHANGE THE DATE to today.

The Surface is almost useless until you do this. Microsoft has released lots of important patches for the Surface but Windows Update does not work while the date is set to the default. It manifested itself in many ways – the normal welcome setup process did not work & I was unable to download my Microsoft profile.

The date issue was not obvious, so I did jump through many hoops. One of the laptops appeared dead for hours on end and I thought that I would have to return it but a forced reboot and that date change and all was well.

More help can be found here

Battery Life

Battery life was found to be lower on the m3 compared to the other models. This was surprising on the “mobility” chipset. The consensus appeared to be that the SkyLake chipset has settings for low power and for overdrive but some internal logic caused the Surface to use overdrive too often reducing battery life too frequently.

There were some articles around this here that I found incredibly useful and help counter the problem

For a finish, it is great to have a laptop that still has an hour left when the battery life dips below 10%


With the keyboard attached, closing the keyboard over the screen can be configured to sleep, hibernate, or shutdown. However, with sleep or hibernate, sometimes, nothing happens when you “open” the keyboard. If it happens, try the following in order until it works.

  • just close and open again – a few times if necessary; this is the most likely solution.
  • press the power button
  • hold the power button for 20-30 seconds
  • hold the power and volume-up button for 20-30 seconds

Bluetooth & WiFi

WiFi performance is far, far better when the Bluetooth is disabled. However, the very cool Surface pen uses Bluetooth so it is a trade-off. Disable Bluetooth if you need to do some serious downloading.

The Surface Pen

… is totally awesome. My son was studying old mathematics exam papers in PDF format. Double-clicking the top of the pen would copy the PDF into OneNote where you could annotate the document, scribbling on equations and graphs.

Handwriting recognition is very nice and, sometimes, I would use the pen over the keyboard because writing just feels so right! The auto-correct works beautifully but words that are run together in web links like “TheJournal” or “NewYorkTimes” are difficult to write correctly; the software does not appear to recognise or allow missing spaces.


The face/eye recognition has improved a lot over the past few months. For a while, I had to remove my glasses to be recognised which was inconvenient since I am almost blind without them. In enhanced security, it does check that I am not 2D, requesting me to shake my head slowly.

The power brick connection is much easier to use than the original Surface. The brick also comes with a USB port for charging another device. It does get very hot and the cable from wall-plug to brick is very short which is impractical for the dog living behind my sofa.

The new type keyboard is an improvement over previous models and is easy to use. It feels far more rigid than earlier versions while still remaining light.

The multi-position kick stand is far better than older versions that had only 1 or 2 positions. I was surprised how easy it was to use both the surface comfortably on my lap while typing on the keyboard.


Overall, I really do enjoy using the Surface and have stopped “borrowing” my better half’s iPad for quick surfing. My son uses his Surface for everything except serious gaming and brings it everywhere.

It would have been nice to have Office included. It was included in some previous iterations and the Surface is not cheap.

But I have no regrets on this purchase.

Waiting for MSSQL Database Restores to complete?

In my current role, we can have a lot of restores in progress during a maintenance window. This handy script allows us to calculate how long the restores will take and when our coffee break will end!

— Check Restores in Progress
        ,CONVERT(NUMERIC(38,2),r.percent_complete) AS [Percent Complete]
        ,CONVERT(VARCHAR(20),DATEADD(ms,r.estimated_completion_time,GetDate()),20) AS [ETA Completion Time]
        ,CONVERT(NUMERIC(38,2),r.total_elapsed_time/1000.0/60.0) AS [Elapsed Min]
        ,CONVERT(NUMERIC(38,2),r.estimated_completion_time/1000.0/60.0) AS [ETA Min]
        ,CONVERT(NUMERIC(38,2),r.estimated_completion_time/1000.0/60.0/60.0) AS [ETA Hours]
        ,CONVERT(VARCHAR(1000),(SELECT SUBSTRING(text,r.statement_start_offset/2,
                                                                CASE WHEN r.statement_end_offset = -1 THEN 1000
                                                                ELSE (r.statement_end_offset-r.statement_start_offset)/2 END)
        sys.dm_exec_requests r
        command LIKE ‘%restore%’;

Did you miss SQLSaturday #501 in Dublin?

As a previous organiser of SQL Saturday events in Dublin, I was bitterly disappointed to miss being an ordinary attendee at this year’s SQL Saturday  ( http://www.sqlsaturday.com/501/eventhome.aspx ). I had registered many months ago. Unfortunately, there was an unavoidable planned monthly maintenance window which lasted the whole day. I had hoped to get away and join the event in the afternoon but it was not to be.

But the great news is that some of the events were recorded and broadcast live on Microsoft’s Channel 9 and they are still available on the website – https://channel9.msdn.com/Events/SQL-Saturday/Learn-more-about-SQL-2016-Live-at-SQL-Saturday-Dublin-Ireland

Thank you to Microsoft and SQLSaturday Dublin for making this possible.

Removing an MSSQL file that was accidently or incorrectly added to a database

Recently, I have had a number of occasions where a new file was accidently added to the SQL Server database; for example, to the wrong file group.

The problem is slightly compounded if there is Transaction Logging in place.

There are number of steps to follow to correct the error

1 – Force the file to be emptied of any data

USE [InsertDatabaseNameHere]
DBCC SHRINKFILE(‘InsertLogicalFileNameHere’, EMPTYFILE);

2 – Remove the file from the database

USE [master]
ALTER DATABASE InsertDatabaseNameHere REMOVE FILE InsertLogicalFileNameHere;

3- If there is Transaction Logging or Log Shipping for this database, run an extra log backup. One cannot remove a file and then create it again within the same transaction log.

4- Add the file again with the correct settings. Change the values below to suit your configuration,

USE [master]

ALTER DATABASE [InsertDatabaseNameHere]
    NAME = N’InsertLogicalFileNameHere’,
    FILENAME = N’Z:\InsertDirectoryPathHere\InsertPhysicalFileNameHere.ndf’,
    SIZE = 1024MB , 
    MAXSIZE = 10240MB ,
) TO FILEGROUP InsertFileGroupNameHere;

Teach kids to code in under an hour with Microsoft & Minecraft

It is great to see that Microsoft has teamed up with Code.org to bring Minecraft to the Hour of Code!

The Minecraft Hour of Code tutorial aims to encourage millions of young people to try an hour of coding as part of Computer Science Education Week (December 7-13). The new tutorial – now available at code.org/mc – introduces players to basic coding within the fun and popular Minecraft environment. Created by Minecraft game designers together with Code.org, the tutorial features Steve and Alex from Minecraft, and Minecraft-inspired challenges that will be familiar to its more than 100 million players around the world. 

Why support it? One of the ways Microsoft brings forth its education mission of empowering every student on the planet to achieve more is by helping them develop essential skills, including computational thinking – so students and all young people can succeed today, and tomorrow. As technology has become an integral part of people’s daily lives around the world, we’re seeing a growing demand — from students, parents, teachers, governments, and nonprofits — to teach youth not only how to use technology, but also how to create technology to help them become the innovators and drivers of growth and opportunity in their communities. Learning computer science builds critical skills like computational thinking and problem solving that strengthen abilities in any industry and any sector. 

About Code.org: Launched in 2013, Code.org is a nonprofit dedicated to expanding access to computer science, and increasing participation by women and underrepresented students of color. Its vision is that every student in every school should have the opportunity to learn computer science. Microsoft continues to be Code.org’s most generous donor and one of the largest supporters of the worldwide movement to give every student the opportunity to learn computer science. 

Take action!  You can sign up to volunteer and support the Hour of Code, and be matched with a local school to host a session. Or connect with your Microsoft contact to pre-record an Hour of Code to share online on Channel 9 . In order to provide you with everything you need to lead your own Hour of Code with the Minecraft Tutorial, Microsoft has prepared an Hour of Code Microsoft Event Toolkit and Readiness Center. In it you will be able to download a facilitator guide, quick tip sheet, PowerPoint slides, and brief orientation video. You can also join a Preparation Webinar with live chat for questions and answers. Register and download your Toolkit today, and get ready to lead your own Hour of Code. 

Looking for more coding opportunities? Find more coding tools and resources for students, parents, and educators at microsoft.com/hourofcode.

My view? As someone who is involved in the CoderDojo in my local school where the kids work with Arduinos and Raspberry PIs, it is great to see Microsoft’s commitment to preparing & empowering the next generation through its Corporate Citizenship programme. I am also proud that the Corporate Citizenship program at my own employer, IBM, actively supports the Irish & international CoderDojo phenomenon, as do Allied Irish Bank and Bank of Ireland.

CHKDSK cancels on virtual Windows 7 startup

It has been a while since I blogged last but I came across this issue today and decide to write about it. I wanted to install two instances of SQL Server to to test different mirroring and log shipping scenarios but my disk was too small.

So, I needed to resize the Windows 7 virtual client on a Linux desktop. However, the resize was failing due to inconsistencies on the Windows virtual drive. To resolve this & correct the errors, I had to run CHKDSK /F.

CHKDSK /F will only run during the Windows start up process. But almost immediately, each & every time, the CHKDSK process would get cancelled.

I did find a hotfix for this known issue on the Microsoft support pages at – https://support.microsoft.com/en-us/kb/975778

However, the patch stopped with the message – “The update is not applicable to your computer.”

Further bingle searches with “linux” &  are “virtual” added as search terms produced a second article that was more specific to my issue – http://mikebeach.org/2011/09/25/windows-chkdsk-at-boot-cancelled-by-phantom-keypress/

Basically linux is sending a keystroke to windows that interrupts the CHKDSK process.

Run CHKNTFS /t:0 before running the CHKDSK /F. This disables the option to interrupt the CHKDSK before it starts. You can always reset it afterwards.

All is good in my virtual windows world now!

AIB supports CoderDojo Coolest Projects 2015

AIB is the exclusive finance partner at 2015 CoderDojo Coolest Projects

As part of its youth segment proposition, AIB Personal Banking for the third year running is sponsoring CoderDojo Coolest Projects Awards. Launched on 31 March in Dublin, AIB is now their exclusive finance partner supporting our brand values in putting the customer first. David Hammond, Head of Personal Banking said “CoderDojo is a superb initiative to develop the coding talents of our young people; it has grown exponentially year on year to the point where 500 participants are expected in 2015. We are pleased to support the innovators and tech creators of the future”.

Coolest Projects offers coders aged 7 – 17 the chance to submit individual or group projects using their creativity and skills with computer languages and hardware to build cool apps, games, websites and robots and the awards are open to all projects created by CoderDojo members.

On June 13th, young coders from Ireland and around the world will compete at the biggest Coolest Projects Awards yet at the RDS. Previous winners of Coolest Projects include 10-year old Lauren Boyle, ‘EU Digital Girl of the Year 2014’ and 12-year old Niamh Scanlon, who last year built an app to allow users of electric cars find free charging points and see whether or not they are currently available.

In addition to this sponsorship CoderDojo supports AIB’s Build a Bank Challenge and looks forward to working together to select the Best Digital Bank Winner at the AIB Build a Bank Challenge National Final on the 16th April.

For more information on CoderDojo and the Coolest Projects, please visit http://coderdojo.com and www.coolestprojects.org


SQL Server Reporting Services not automatically starting after a reboot

I am surprised how often I get this alert from SCOM – “The Windows service for the Reporting Services instance MSSQLSERVER has stopped on computer XYZ”.

I have seen this more than a couple of times and thought it worth blogging about.

Check the Windows Event Logs (System) and look for “Service Control Manager” failures around the last reboot time with the error message “The SQL Server Reporting Services (MSSQLSERVER) service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion”. There is usually a second failure nearby : “A timeout was reached (30000 milliseconds) while waiting for the SQL Server Reporting Services (MSSQLSERVER) service to connect.”

The solution is to increase the default service time-out as follows :

  • Open Regedit
  • Navigate to: KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
  • Create a new DWORD value called ServicesPipeTimeout
  • Modify it and ensure it is set to Decimal  and enter the value 60000
  • Close Regedit
  • Reboot the server
  • Confirm that SQL Reporting services satrted correctly

Be aware that this affects all windows services and not just Reporting Services. For safety, backup the registry before applying any changes.

Effective Indexing – Niall Flanagan – Belfast, May 15th 2014

This topic will cover the performance benefits and important considerations of good indexing design in SQL Server including

  • Considerations
  • Benefits & Concepts
  • Statistics
  • Table/Index Design
  • Clustered, Non-clustered, & Heap
  • Fragmentation
  • Why cheap hardware is not always the answer

About Niall:
Niall Flanagan is a Team Lead in a Database Services team that manages production Oracle, Sybase and SQL Server databases in a large Irish retail bank. Niall founded the SQL Server Ireland User Group in early 2006 and continues to lead it. In addition, he presents on SQL Server to various user groups and conferences throughout Ireland. Niall is a Microsoft SQL Server Most Valued Professional (MVP) since October 2006.

Adelaide Exchange Belfast.

Registration: http://www.mtug.ie/events/event/effective-indexing-belast-sql-user-group/

When: May 15th, 2014 18:00 – 20:30

%d bloggers like this: