Showing posts with label Sleep. Show all posts
Showing posts with label Sleep. Show all posts

Tuesday, 12 May 2020

Reverting to Morning from Night Owl

I have recently, with the lock down slipped back into some very old; almost genetic; bad habits, the worst being a total night owl and it has to stop.

But that's easier said than done as I'm one of those people who have to work hard in order to get up early... In this post, let me explain why and at the end I'll share two key strategies I use to make myself get up and stay up early.


As a Night Owl Child & Teen
I have always been a night owl, always, I have been told as a young child I would be up all night long and this continued into my teens as I discovered computers... With only one machine in the house, which was time shared between myself, Brother and Father, I would of course join them, but "that boring stuff" of programming, was something I did alone at night in to the very small hours.

My Dad worked shifts, his rising and sleeping being all over the place, my Mother didn't have any set pattern for sleep she let us sleep.  Only when we stayed with my Grandad did he make me to wake and rise with him.

So it was that as I hit college, at home the family bought a PC and I began to learn Pascal, oh the hours flew by.  The Borland Turbo Pascal compiler having that all enchanting count of lines as it chewed through your code.


University Slumber
Then as I entered University I had a predilection for the wee small hours and any lecture scheduled before 11am was a dire circumstance, and I couldn't help it.  But I recall that the faculty appeared to identify with their charges.


First Dawn Chorus
The first time in my life I then had to revert to a morning schedule was for work, the all important money, the fortune (not) that could be earned.  My first IT role started at 7am everyday and often ran until 7pm.  Though only payed for the hours between 9 and 5 (sneaky of them).

It was however just over an hour from my bed to work, and I had to get up, clean up after our dogs and then get myself ready, so an alarm prior to 6am was the norm.  For two years regular as clockwork, up at 6am out and gone.  In this role I traveled a good slice of the globe too, and always found as long as I kept my sleeping schedule I could cope.

Being young was of course a boon.


Slipping
In my twenties, having left my first expansive role, I made the hideous mistake of living within walking distance of the office but driving to it in my brand new car, an utter destruction of any chance to wake before plonking myself behind a keyboard all day.  Something I was somewhat suffering from of late during lockdown.


Slipped
The worst this got was after leaving this second role, being head hunted no less, I joined a company which again demanded just over an hours drive from my bed and my failing to get back into the swing of getting up early.

I didn't stay long, my concentration was all over and besides I found a National level gaming team and World of Warcraft taking far too much of my time to worry about work.


An Average Decade
Through my remaining twenties and thirties I was variously an early or late riser, finally settling on a routine which suited the flexible hours and schedule of the role I held.  But was decidedly late to bed and late to rise.


Starting Early and Promotion
After ten years of starting later and heading to the twilight years of my thirties I started to rise earlier, this was partly driven by a desire to do more with my day; as it had slipped into rise and work, return and vegetate before the black mirror.

The horses, and their needing to be tended to in the morning, my wife's health not allowing her to rise early.

And then I got promoted, so I had to be there before other folks and be on hand throughout their day, so I started to rise earlier, from an 8am start I began to ebb towards 7am then 6am, so that I was in the office for longer hours, but got huge slices of work done before the main body of folks arrived to query and take their direction off of me.  Similarly however I was working late in to the evenings and then also spending time with the Mrs, so I did suffer a little and weekends were the time in which I collected on my sleep debt.


Sleep Disorder
It wasn't sustainable and I have actually developed a sleep disorder because of that and other factors from my life style.


Lockdown
As the lockdown bit, for the first time in my life working solidly from home, put my bed closer to my desk than ever before.... literally feet... and you know what... it was dire.

I began working til first midnight, then 1am, then 2am... finally at 3am... and then rising zombie like on or before 9 to start the next days meetings.

Something had to change.


Strategies for Reverting
The first of two prime strategies I employed are going to bed earlier, this was to be pretty strict, no reading in bed, no laptop in bed, no notebooks.... Bed was for sleep and nothing more.

The second is a pint of water, set beside my bed, the first thing to do is get up on the alarm, never hit that cursed sleep button, sit up and drink that water.

With these two and a lot of will power have broken the spell of lockdown doldrums.

One key part of this time in a morning is to do something for myself, especially during the lockdown, whether that's a coffee looking at the garden, a walk from the car to the office or even twenty minutes playing a game or reading an article or two.

Do nothing related to the day ahead in that time, make it something you want to do, either something exciting or interesting or simply plainly different to the day about to dawn.

Saturday, 13 May 2017

Story Time : "Younger Man" with Sleep Apnoea

Not dissimilar to the description J K Rowling gives to the character of Uncle Vernon in the Harry Potter series, I am a "Big Beefy Man" with "not much neck".

As a result last year it became blindingly obvious that my waist was expanding, I also personally noticed a drop in my day-time alertness.  Initially I would like to point out that I have always been a night owl, and it was not uncommon for me to stay up late and get stuff done (especially programming things) and then sleep later.

This fit well with my employment offering flexible start hours too, and so happily for very many years, I got slowly fatter and fatter, sitting down and eating too much, and I slept later and all was merry.

Except, it wasn't... I suddenly noticed I had become extremely moody, irritable, bad tempered, my concentration was dropping and I found it nearly impossible to remember new things.  Initially I bit back my bad temper, and to compensate I started to use a series of physical notebooks and then scheduling apps to help abate my failing memory.

This crooked self-dillusion carried on for about four weeks, the wife later told me I was a nightmare to live with, however at the time I could not explain the reasons for the change, I could think I didn't want to act that way, I didn't want to forget my lunch, or eat junk, or be a bastard.  But I was being, and there was nothing I could seemingly do about it.

So, I took a few days to think about what I was doing, what had changed, I was very tired, I had to admit.  I kept going though... Kept going, caffeine, pushing black coffee down me, and sugar, lots of sugar.  I never felt I was eating well, but I needed the energy, without it I faltered, stumbled and one day I said "no caffeine today, lets see how I get along".

Driving home one moment I was at red lights, a blaze of other tail lights a head of me, the next blink, I was alone... Sat at the lights still, no-one around me... I had fallen asleep at the wheel.

I literally pulled over and slept there and then.

I contacted my GP, and said "I think I have sleep apnoea", this notified the DVLA, I suspended driving and got one with treatment... Unfortunately this took sometime, so my coping mechanism in the meantime was to sit up in bed more, and to fit a black-out blind to the window.

This alleviated symptoms, but I knew I wasn't sleeping deeply, a short time later and a night of sleep monitoring it was confirmed, I have obstructive sleep apnoea.

I thought this was because I was fat, because I was getting older.  But it seems thats not just it, I am large, and all my family are.  However, the tiredness makes you want to eat more, the BBC has recently covered this phenomenon more than once, and I have to admit it was nice to hear.

I was issued with a CPAP machine, was immediately sleeping so much better.  It was like night and day.  And for the last year I have enjoyed this machine immensely.

However, the straps for the masks go slack over time, as they go slack your sleep falters again, as a man if you have too much facial hair air escapes the mask (have a beard but very short trimmed it's not a problem), far more of a problem is how the mask  seal skirt wear and then the straps go slowly slack.

I would have to argue that the company making these (Phillips) could be held somewhat to account for the latter, as it seems to happen at a predictable, almost designed rate, however I have to concede that the material used has certain requirements and the felt like vencro fastening straps with their slight elasticity are pretty good, but the continual re-stressing of the product does result in quite quick deterioration in performance, even before you take into account the biological factor (sweat & skin cells, and having to then wash the straps).

However a year on, I'm not wondering whether the machine is enough for my condition, I've noticed more than just slack straps, more than wearing seal skirts, more than just a bad nights sleep that more days than not I am quite tired of a day.

This is not everyday, but perhaps two days every fortnight or so, there's no obvious reason for this biologically, environmentally there's no changes either.  I have to admit to slightly more stress in my life at present, however pressure or stress have never stopped me sleeping before (a side effect of studying the martial arts - if a bloke bigger than me can hit me, a bit of code not working in the office is nothing to sweat over).

I will have to discuss this with my consultant in early June.

Being an every inquisitive soul I have started to look at other factors into why I might have apnoea whilst my brother (a close body match to me) does not, and as far as I know no-one else in my family - despite our having a string of heavy snorers - doesn't have apnoea.

One thing I mulled over, before doing some reading, is that during my mid to late teens I had orthodontic treatment, I had four healty pre-molar teeth removed and the two following molars behind these pulled forward.

I've just read, in two sources, that these molars play a role in strengthening the stiffening the sides of the soft pallet, and they also provide a framework onto which the throat muscles structure, then of course the net result is that your jaw is shrunk, leaving less room for the tongue.

I have to be completely honest here, if I let my tongue rest in as natural a position as it can, as easy feeling as it can be, it sticks out over the end of my lower front teeth.  But sits slightly behind my upper bite.

I have the distinct feeling that if I had not had this procedure, yes I would have slightly wonky front teeth, and yes there may not have been space for my wisdom teeth to fill in but my tongue would fit inside my teeth.

As a consequence of this poor fit I have to draw my tongue slightly backwards, with a kink mid-way, to let it sit behind my lower teeth, add the very nature of the action of the flesh being slack in my apnoea and this is a recipe for real trouble.

Having made mention of my weight problem, I did grow whilst without my CPAP machine, I went up to 21 stones around July 2016, by December I was 19 stones, and now today at posting, I am 17 stones and 9 pounds, you can go convert that yourself.

I'm still big, but I feel so much better, even with a few crappy days sleep I feel so much better.

Coming up in June, lets see if my consultant agrees with my orthodontic question, and if I need anything corrected or improved with my CPAP machine.

Tuesday, 3 February 2015

Into The Woods : It's A Fucking Musical!

Stop, stop right there... Yes even you at the back... Stop...

Watch this...


Right, you watched that, which is the official trailer from July 2014 for "Into The Woods"... Right, you may have recognised a few of the cast, James Corden, Meryl Streep, Tracy Ulman, Chris Pine, Anna Kendrick and the delectable Emily Blunt...

Looks a pretty cool film from that trailer...

You know what this trailer totally and utterly does NOT contain?...

Singing...

You know what none of those cast members are really known for?...

Singing...

Johnny Depp, we forgave you for the Demon Barber bullshit, but why are you here in this for like five minutes flat?  Seriously, five minutes and you got a special "and Johnny Depp" in the titles...

Yes, folks, this fucking film is full of singing, it's a musical... Something I, my wife and my mother-in-law failed to spot before paying to see this fucking thing last weekend.

We went based on this very trailer, we saw that before another film a few weeks before and thought this was pretty much just our sort of thing... Ner.

It's a fucking musical, I saw it say at the beginning "From the Director of Chicago", and I thought... "I hope that's the gangster kind, not that singing shit"... FUCK.

We were genuinely surprised and a little let down, the film was okay, there are glaring problems with the plot, which they wound up and threw away... "Jack your mother died"... no she didn't, she bumped her head, what the fuck!??!?!

Meryl Streep was very good, but they just disposed of her character in the oddest way, and the ending was rubbish...

The family sat behind us in the packed auditorium summed it up best... As the little girl turns to her Dad... "That was a nice film, how long have we been here?".... And his reply "I don't know, but it feels like forever".

I nearly fell asleep at one point, but I'm not paying £9.50 to fall asleep... I feel a little ripped off, and I'd never have gone to see the film with a more representative trailer.

The November 2014 Trailer is different in one key way... Yes, it includes the singing.



Friday, 21 November 2014

Story Time - Programmers Sleeping

Once upon a time I was a loud mouthed, big headed, my code could never be wrong, I'm invincible... 


Kind of programmer...

Over time you will, unless you never go out, you will meet programmers who know more things about you, either about everything, or about certain specific things, and you have to learn to evolve and understand they just know more than you.

They might have been through the problem you're wrestling with for the first time, they might have worked on the base system, or they might just recognise the pattern of the problem you've got.

So don't just dismiss these folks, they know what they're talking about, and even if they don't take it, analyse where they've gone wrong and you learn from it, do not do what happened to me...

We're about six years ago now, and we had a graphical system, this system had been running games from many different sources for several years (about four) so it was a tried system, the hardware was known, it had known bounds and I personally had handled maybe a dozen different people working on it before, their games all worked, and I turn around and can see 32+ games working still to this day.

One thing I don't see right now however is this game from this one guy, because... He's a douche, and I don't actually see him because he no longer works here, of all the folks in his department he was the first gone of his own accord, because... well because he was one of those programmers, one of those people who never really grew up, he considered himself above reproach, he was perfect, his code was perfect and any issues were yours.

So, let us just dive off to games, games at their heart have a loop, which reads/updates the data, plays sound and critically updates the graphics, that's the core of all games from Battle Chess to Call of Duty, this game loop is time critical, if you delay the update or the display the game will look like it's stuck, or juddering, people often call this lagging, but the problem is that loop for interrupted to things didn't look smooth or play smooth.

But computers are fast! So for most trivial problems the data can be updated and the display redrawn faster than the hardware is actually limited to, so the hardware is done and sat idle waiting for the next rendering of the game.

This is called the sleep or delay, and games use this time to do other things, like perhaps check for updates or sort data.

Now this delay has to be controlled, you have to make it a fixed length, or set it up so that the machine works out how long the work it did was since it last drew the screen, and wait for the difference in time to smooth out the drawing.  This makes the game play smoothly, makes animation behave smoothly...

So, if you have a loop and you just randomly sleep for X time, but then the data processing you're doing takes longer than X the game will look like it's stuttering.... How can this happen?...

Well, how about this code:

while ( true )
{
    Update();
    Draw();
    Sleep(1000);
}

So, we update, then draw ,then sleep for 1 second.. okay, but what if the processing in "update" takes 800ms, how long will we take between draws now?... How about 1.8 seconds!  So that cycle the game will look like it took nearly twice as long to draw, and animations will stutter.

What has this got to do with programming?

Well, once upon a time this very code above strolled into view, and the programmer working with it kept saying "your machine is making my game stutter, it runs fine on my machine"... His machine being a more powerful machine with dual core and more RAM... So I pointed this out, he then set about trying to explain it all away.

When he then showed me this code, I just pointed at the sleep and went back to my desk, it was not my job nor part of my remit to work or debug his code, I saw this problem was simply he wasn't changing how long he slept for, but also he was very confrontational, because the contract with the "Sleep" function on Windows (the platform we were using) is not quite what most programmers expect.

You see sleep will go away and pause a process/thread for X amount of time, and it will come back to continue processing up to or after that time... Up to or after... Not immediately, so in a game you can't guarantee that the Windows Scheduler will pick up your thread and come back to your program immediately after 1000ms above!

I told this chap this, and he flat argued, he even went so far as to print out the MSDN documentation pointing out that I was wrong, and I was a wanker, and he went on a tirade around the office.

It was only later I went back and pointed out that he was referencing the sleep function for Windows Mobile, not Windows XP, and going to the right Operating System on the MSDN page, it said "upto or after the delay".

He didn't say sorry, he didn't say anything, he actually sat down and said "fat wanker".

Lucky for him my boss was stood right there and heard him say this, so I left them to it, but I never spoke to this cunt every again, he left the company soon after, he'd apparently agitated not just me but about six other people, arguing when they knew their stuff and then insulting them.

He was perhaps the third worst person I've worked with at this company.


For information about how sleep works, and how variable it can be, check this out.

Friday, 7 February 2014

Must not listen to office morons talking about building their own PC's... Must resist... Must not rise to them...


The conversation about PC's started about the person buying new kit going from an AMD product to an Intel product, then to the giant can or worms that is "Re-installing Windows 7", and then his recommending to someone else to buy a big fat new copy of windows (instead of just buying one of the perfectly legal and legit OEM stickered ones from people like Spartan).

And then he dived into his ultra cool cooling system... Which was... a case fan... yes he added one, finally.. 2014... Case Fan... Right dude... I got four and memory fans, plus a water system from CPU to GPU and out to a major dual 180mm fan radiators...

And then he started to bemoan hos loud the fans are... I could point him back to my silent fan reviews from what... two years ago... but... I can't... I can't get involved.


In other news, on top of Thursdays post about sleep, I was in bed last night at like 9:20pm and I got up for work at 5:50am... I was here and working - after a nice breakfast - at 6:50am.

Usually, when I get up at 9:20am I'm here and working by 9:50am... So, why did getting up early take nearly an hour to deliver me to work, when getting up late gets me here quick?... Hmmm...

Thursday, 6 February 2014

Sleep and Work

Embarrassing confessions time... I was just watching Good Mythical Morning 374, today's edition, and they're talking about sleep & sleeping  habits.


And I was just thinking I need to improve my sleep quality, and then the embarrassment set in...

I remember in a job I had 12 years ago, whilst in a face to face meeting with the owner of the company, so my uber boss... I feel asleep...

Right in front of the guy... he wasn't being boring, he was actually offering me interesting work, but at the time my sleep was so pitiful, and there were so many problems at home with my then girlfriend I just was not getting any sleep.

In fact, not to make excuses, but I went to work to get some peace and quiet.  It was a good job, I should have tried harder, and in fact the day I left it I went home and the girlfriend was gone... and it was praise be... I do wonder to this day if I should have got a good nights sleep and then just gone back to them and explained, but I never did.

I never told them about her activities, and she got up to some funky things, and like 18 months after she'd just walked out, well... I got a credit card company knocking on the door asking for £14,000... Which she'd spent.

All this was my fault, I let my life change so dramatically, and the rubber band broke.  It was ironic really because for months before this job I basically poisoned with lack of sleep, I was getting up at like 5am each morning and driving 70 odd miles to my previous place of work, beavering away there until at least 7pm at night and heading 70 miles home again... to basically dead sleep until the next morning...

But I was living on junk food and youth, and the then girlfriend didn't live with me... the moment I got the job closer to home, she moved in... my brother moved in with me, having been made homeless, and basically my job, my life, my way of working was lost.

I regained it when she'd left and I made my brother move on, I had like two weeks and was into one of the longest and best roles I ever had, and I delivered, but I always wish I'd delivered to that previous company who had took me on... I never spoke to them about it, in fact when the Director spoke to me I just admitted my faults and accepted the inevitable, because... well I was through fighting, to get home and find the girl gone was a blessing.

If those previous employers out there read this... Vanessa, Stuart, et al.... Sorry folks, I was a sleep deprived knob.

Tuesday, 3 December 2013

Power Nap

Power nap, so through one thing and another, I've not been sleeping well in the evenings, this has been cutting into family life and of course game time... but its also why I've gotten a few mid-night gaming sessions in.

However, today I think my body is ready to just throw in the towel and let me sleep tonight... I'm not going to get home until at least 19:30 and I'm clearly not going to get to bed much before 22:00... But I hope I sleep right through.

What I have just done is take a power nap, I clocked out and went to my car, it was freezing cold, but I set the seat back and closed my eyes, 10 minutes... and boom I'm back in, the shiver of sleep which was creeping over me has been put at bay, lets hope it holds off.

I don't know how good or bad doing a power nap like that is, I hear tell of a kind of sleep pattern were people get into sleeping for like 10 minutes every 3 hours, and they massivly improve their productivity?  I think certain online gamers I know/knew must have done this, the amount of time they spent raiding and grinding.