September 19, 2020
I hit a milestone and achieved a goal

Update: 6 months later, another milestone! 😃

30lbs lost in 4 months

Sidetracking for a second here to share some exciting news. Today I both hit a milestone and achieved a goal. The goal was to have my website back up and running by the time I reach the "30lbs lost" milestone.

Today both of these things were realized.

This for me is a monumental personal achievement! Today I weigh 30lbs less than back when I started this journey 4 months ago. I have not been this weight in over a decade.

If you're wondering how, this article will outline what worked for me. Please note that I am not a nutritionist or a dietary expert so take my advice with a grain of salt (hah).

The secret is very simple: I write down everything I eat now. I don't imagine I'll do this forever, as months go on I have a better grasp of what to eat and how much to eat but it's helped me keep on track. I use MyFitnessPal Premium. This app allows me to visualize macro-nutrients (carbs, fats, proteins), see my history, and keeps me pretty motivated day after day. I'm not being 100% accurate at tracking every single calorie and I suggest you don't either if you decide to do this, as it's not good for your mental health. It's easy to fall into a trap and develop a disorder if you become obsessed. Do your best and try to be as accurate as possible without sweating the small details.

The best way to get started is setting a daily limit (macros or calories). The app will help you set a goal (which you can adjust as you go along). For example let's say you set yourself on a "2000 calories a day" limit, your goal is to consume as much healthy foods as you can in a day to add up to ~2000 calories. I say healthy as you will soon learn a lot about how you eat, what kind of crap is in your food but most of all, how much you have been overeating every day. That's it. Stick to that and you'll reach your weight goal.

My wife and I have also been "meat-free" for nearly a year now. For me this decision was personal as my cholesterol was high and my doctor said--in these words--"change something or I will have to put you on a pill".

We tried the plant-based approach, which I have to tell you has worked out really well. We still eat fish and eggs, and some cheese/dairy (so it's more of a pescatarian lifestyle) but have been replacing for example a juicy, fatty beef burger with a form of this amazing black bean burger recipe. There's tons of options for non-meat-lovers out there these days.

I'm not saying you should stop eating meat, even though there's a lot of resources out there that may sway you to do so for a lot of different reasons, but I am saying be conscious of what you put in your body.

Cutting meat out of our diet did not reduce my weight and it barely reduced my cholesterol, though that's hard to judge as I found myself snacking on junk more, which probably contributed to the elevated cholesterol still.

The only thing that has worked so far was setting a limit and sticking to it. Like I said, if you do this you'll soon find out how to pack yourself with nutrients to keep you full and feeling good. Your appetite will also change and over time the cravings for crap go away.

Our plant-based diet (lifestyle, not diet) also consists of eating very minimal fried foods and processed foods. I consider "Beyond Meat" as processed food too so we don't use it as a daily alternate to meat. We are limiting pastas, breads and junk foods (chips, cookies etc). We still indulge every now and then, but stick to the recommended serving size--which for chips (crisps) is a bowl of chips, not half the bag 😄. Indulge, but indulge responsibly. It keeps good mental balance as well as physical balance.

These are the main contributors to where I am at today. Cholesterol has now dropped by 30% and I'm 30lbs lighter. The magic number 30!

That's all for now. Hope you have a great weekend!


September 19, 2020
Calculating Good Friday in T-SQL

A few years back I had to generate a table using T-SQL that lists Canadian holidays for the upcoming x number of years. This was part of our migration from our old Nortel phone system to Skype for Business Public Telephony. This requirement was for programming the after-hours and holiday menus for the upcoming number of years. I think back to this task every now and then because it was a fun little challenge.

Most of the holidays are simple to calculate because they fall on the same day every year but Easter or Good Friday are based on the Paschal Full Moon following the spring equinox, which changes year to year. So here's a script based on this post, which is based on a script from NOAA, to calculate Good Friday:

CREATE FUNCTION dbo.uf_GetGoodFriday (@Year INT)
RETURNS datetime 
WITH EXECUTE AS CALLER
AS 
BEGIN 
	DECLARE @intYear INT, @EpactCalc INT, @PaschalDaysCalc INT, @NumOfDaysToSunday INT, @EasterMonth INT, @EasterDay INT 

	SET @EpactCalc = (24 + 19 * (@Year % 19)) % 30 
	SET @PaschalDaysCalc = @EpactCalc - (@EpactCalc / 28) 
	SET @NumOfDaysToSunday = @PaschalDaysCalc - ((@Year + @Year / 4 + @PaschalDaysCalc - 13) % 7) 

	SET @EasterMonth = 3 + (@NumOfDaysToSunday + 40) / 44 
	SET @EasterDay = @NumOfDaysToSunday + 28 - (31 * (@EasterMonth / 4)) 

	RETURN ( 
		SELECT DATEADD(dd,-2,CONVERT(DATETIME, CONVERT(VARCHAR(2),@EasterMonth) + '/' + CONVERT(VARCHAR(2),@EasterDay) + '/' + CONVERT(VARCHAR(4), @Year)))
	) 
END
GO

Trying it out for next year:

SELECT uf_GetGoodFriday (2021)

Returns:

2021-04-02 00:00:00.000

September 17, 2020
Hello, world!

Welcome to the newest rendition of my website. This is version 4--or maybe 24 by now, it's hard to keep track--and if you're saying to yourself "hey, this layout looks familiar" you must've seen my friend Tim's page and realized that this is pretty much a copy of his site. And you'd be right, the layout definitely is a direct copy (the back end, not so much). His site is actually available at GitHub if you're cool enough to be in the Ruby on Rails crowd. I am unfortunately not so it's just PHP in the back end, Smarty in the middle, and Bootstrap in the front here.

I plan to build on this in the future (some more functionality, etc.) but as a foundation, this pretty much suits what I wanted to get out of this space perfectly. Thanks Tim!

If you want, you can find the previous iteration of my site, now frozen in time, over at 2020.miklos.ca

I can't believe it's been over 7 years since I've done anything in this space. So much has happened! The last I left it, I got married, we then had a baby, bought a new car, moved to a new house, yadda yadda yadda and here we are.

Anyway, I hope you enjoy your stay.