Live data from Hacker News

Waking up at 5am to code

mattgreer.org

191–200 of 202 posts

Re: Waking up at 5am to code

#191

Earlier quoted context omitted.

I'm not sure about the two hour timespan, but brightness appears to have an effect on sleep latency and the time it takes to fall asleep. Studies [edit: PDFs]: [1] http://www.journalsleep.org/Articles/250312.pdf [2] http://www.sciencesleep.org/ziliao/Effects%20of%20playing%20... [3] http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2869.2005....

Definitely install F.lux: http://stereopsis.com/flux/ It adjusts the color temperature of your monitor as the sun goes down. As the sun sets, your monitor becomes more red/pink. It takes a little while to get used to it, but I absolutely cannot stand normal monitors at night time now. When I occasionally disable F.lux to watch a movie at night, I'm blinded by the bright blue glow.

for linux: redshift is packaged for most distros.

https://launchpad.net/redshift

Re: Waking up at 5am to code

#192
post #190

Earlier quoted context omitted.

This is good advice. Taking melatonin when you go to bed will help you sleep, but taking it a few hours before you want to go to bed helps retrain your circadian cycle (which is the goal, not just going to sleep easily)

Do you have a source you can cite for this? I'm keenly interested in how this works.

I suggest reading this: http://www.medicinenet.com/jet_lag/page4.htm

Re: Waking up at 5am to code

#194

> Enjoying the work is key Recently I've discovered that this mindset has been detrimental. Sometimes hard work is supposed to be hard. If you rely on passion or some sort of intrinsic motivation, then as soon as you come to a task you don't want to do (i.e. the 90% of any project that doesn't involve coding) procrastination sets in. I worked mornings non-stop on my little side project for around 6 months last year a…

Maybe I just read it differently, but for me this article described a way to cram things that I _want_ to do (other people might play the violin every night at 20 for fun?) into the early morning hours.

You're making a good point, _if_ we're talking about doing business in these hours (like trying to progress on your own little startup idea). If you just want to meddle with a small project, experiment with this $randomNewTech or improve your code for the fun of it, then this attitude of 'It should be fun' seems perfectly alright.

Re: Waking up at 5am to code

#195

> Enjoying the work is key Recently I've discovered that this mindset has been detrimental. Sometimes hard work is supposed to be hard. If you rely on passion or some sort of intrinsic motivation, then as soon as you come to a task you don't want to do (i.e. the 90% of any project that doesn't involve coding) procrastination sets in. I worked mornings non-stop on my little side project for around 6 months last year a…

Maybe I just read it differently, but for me this article described a way to cram things that I _want_ to do (other people might play the violin every night at 20 for fun?) into the early morning hours. You're making a good point, _if_ we're talking about doing business in these hours (like trying to progress on your own little startup idea). If you just want to meddle with a small project, experiment with this $rand…

I think doing work you don't like or that you find difficult is compatible with new tech you want to learn just for the heck of it.

As an example I'm currently trying to deep-dive on Natural Language Processing. I'm a middling programmer but quite useless at Maths, so I know my weak points are going to be the stats used in NLP.

In this, I've picked up the most highly recommended university level NLP text I could find I'm putting in a couple of hours a week studying it. After about thirty minutes in, I begin losing focus and it starts becoming really easy to think of distractions or reasons why I shouldn't be doing it.

It's at times like that when it helps to realize that no, I should be doing this, I don't need to take a break, I should just power through. I'm not necessarily enjoying everything I do in these sessions, and it's definitely hard work in unfamiliar territory.

I've found that concentration is like a muscle, the more you train it, the harder and longer you can maintain it without taking a break. For me, expecting the work to be fun sets me up to give in as soon as I start losing focus.

Interestingly, after going at work 100% for hours at a time, I actually feel way better than I do than after a half-arsed attempt at productivity. Usually I've created or learned something, and I don't have that guilty feeling that I could have got more done today.

Re: Waking up at 5am to code

#196
There's probably little to add here, but since I've been doing a 5am coding period each morning for the last year.

First, I am 42, married with 1 kid, so that may explain some of it. ;)

Some keys: 1) Coffee maker on autobrew, but not immediately upon waking. Give yourself and your stomach time to wake up.

2) Eat and/or drink something easy upon waking. I go for the MixOne protein shakes, or OJ.

3) A clear goal of what to accomplish that morning.

4) Get enough sleep or you will burn out and have to stop for a time period of recovery. I go to sleep or rather, my body & mind collapse, at 9PM. Asleep by 9:30. I am able to get 7-8 hours of sleep every night. More than plenty.

5) Don't use anything with a screen (except maybe an e-ink Kindle) before bed. Reading helps me to get right to sleep.

Due to having a kid in preschool, I generally am limited to 1-1.5 hours in the morning. Which is just enough time to do one task and very little else, hence the need to focus on something.

Re: Waking up at 5am to code

#197
post #69

Earlier quoted context omitted.

That's interesting. When I was in college I used to wake up at 5am every morning. I'd always start my day by taking the trash outside and looking at the sun come up over the ocean. (I went to school in Santa Cruz). Those short moments always set the tone for the rest of my day.

> I'd always start my day by taking the trash outside and looking at the sun come up over the ocean. (I went to school in Santa Cruz). I suppose I understand what you're trying to say, but the idea of watching a Pacific Coast sunrise from Califonia (while not in an airplane or other fast-moving vehicle) breaks my mind a little. But your comment also made me realize I'd lived within a half hour drive of the Pacific Oc…

bit late but ... you can also see this from the santa barbara harbor. I used to surf there in the early morning and the sun would be rising behind the waves. Not a lot of places on the west coast that that happens!

Re: Waking up at 5am to code

#198
post #185

Earlier quoted context omitted.

I've recently done this, and it helps when I'm on-call and get woke up in the night. I can now fall back asleep faster. Another item that helped, I've put oil lanterns up on the walls in my home office. I just got to remember to light them instead of flipping on a light switch, and all is good.

That's a nice touch I hadn't thought of. Any ones you like in particular?

I picked up a couple of generic ones, I think they are made by Lamplight Farms. They include a bracket that hangs on the wall with a reflector plate. Other than the wall mount, most of the oil lamps are about the same (that is, the ones in the $5 - $20 range). Of course, I picked up these ones about 10 years ago, and I can't find this particular model any more. I can only find the table top ones (could probably put it on a shelf, with a mirror behind it for better effect).

You can use either lamp oil or kerosene in most of them, the lamp oil doesn't stink as bad (and if you get the "ultra pure" oil, there is hardly any smell at all). Also, last time I had a power outage I was able to keep the flame lit (on a pilot light height) through the night with hardly any oil used (and it made a nice night light -- don't know how safe it is though).

Re: Waking up at 5am to code

#199

Earlier quoted context omitted.

You should try taking 5mg of melatonin around 9pm. I have trouble falling asleep before 12-1am, too. Undeterred, I stay up too late every night working on whatever project I have and can't sleep because I'll lay awake thinking about it. If I take a melatonin I get the benefit of becoming inept at writing code by 10 and will be sound asleep before 11 and ready to wake up hours before I have to start my day.

My sleep doctor advised taking less, and earlier (1.5 mg around 5 or 6 pm).

You have sleep doctors in the US? seriously?
Post reply on HN