Segmented sleep for 5 weeks

For the next 5 weeks, I will be sleeping from 23:00-2:00 and 4:00-7:00, totaling in 6 hours of sleep per day. This is known as the segmented sleep schedule. If it goes well, I will likely continue with this schedule. For some of you 6 hours probably sounds like a lot, but I usually get 8 hours, so cutting out 2 is a significant improvement.

My motive behind doing this is that I was recently offered a research opportunity that I could not refuse (I will likely post about it later). To make time for it, I had to sacrifice something – my choice was sleep. About a year ago I was on a similar routine and it worked well, but I haven’t had the motivation to start doing it again until now.

Continue reading

Dabbling around with Haskell

So last night I went to a Haskell workshop.

One of the examples my professor gave was the factorial function:

The first line is the function signature, the second line is the base case, and the third line is the recursive step of the function. One thing I really like about Haskell so far is how clean recursive functions are.

Today I started dabbling a bit more with Haskell and created a recursive function to calculate pi using the Gregory–Leibniz formula:

I had to name it “pie” because “pi” was a reserved keyword. The “fromIntegral n” is there to allow an integer to be part of a fractional calculation. This is necessary because Haskell is über strict with types.

Here it is in action:

Gravity Simulator

A while ago I made a physics simulator for projectile motion which would gravitate towards the ground. I decided to build off this idea and make a free space gravity simulator!!!

To launch new planets, click and drag. When the planets collide, they will create a larger planet with a greater mass. The dynamics of this were done in a 3D perspective, so that is why planets grow very slowly in proportion to their mass build up (the mass is proportional to the cube root of the radius).
Check it out!

Conservation of momentum is followed, so launching a small planet with a high velocity at a large planet will produce a small velocity change due to the mass difference 🙂

I made a Chrome plugin!

So I am currently facilitating the hardware room at the UTM Hacks hackathon… Currently, everyone is settled down and hardware registration has been dead for a while, so I created a Chrome plugin!

The functionality is to play elevator music whenever you are on a login page. In my opinion, this is arguably one of the best plugins ever written 😉

Without further ado, here it is!