Image for post
Image for post
“body of water in front of mountain ranges” by mckenzie toyne on Unsplash

There are times when I catch a look at myself and immediately make note of my flaws. “I could be in better shape, I should really dress better, I’m really not eating all that healthy”. The same applies to where I am currently in life. “I should have already found a career, I could be starting a family now, so many people I know are much more accomplished than I am”. It is easy to look back on the decisions I’ve made up until now and see how much more I could have done, how much better a position I could be in if I had been more assertive, had more drive, chosen to put more time into actions that would advance me instead of choosing to indulge in the pleasures of the moment. Television, video games and social media absorbing hour on hour, page after page refreshing to see if there’s anything interesting and if there isn’t, then peruse the next site. Rinse and repeat, telling myself that I would get around to what I wanted to get to later, with “later” slipping further and further away from me until I realized that I had fallen into habits generating the opposite result from what I wanted in the first place. …


When designing your web page, you may come across a situation where you want to have a portion of your content stay with the user as they scroll down your page. Now what if in addition to that, you don’t want your header to interfere with your hero image or other element on the top of your page. Fear not fellow developers, for here is an elegant solution that can be implemented with ease: A scroll-to-fixed header bar.

Image for post
Image for post
State 1: the search bar above is positioned using position: absolute

In essence what we are doing is transitioning between two states, the first one takes place when the user is scrolled to the top of the page, where our header bar is not visible, and our search bar (pictured above) is below our page title. The second state (below) we make our header bar visible and change our search bar from position: absolute to position: fixed. …


Image for post
Image for post

For a lot of people who are beginning their journey into programming, the concept of data structures and their uses does not get a lot of coverage, in part due to the small size and scope of the projects that can be completed in the small time frame. This does, however lead to a lack of foresight down the line because as projects get larger and larger, understanding how a properly implemented data structure can make your end program run much more efficiently. Today we will look at just one method of collection, the Binary Heap.

What the Heck is a Binary Heap?

A Binary Heap is an implementation of the Heap data structure, a way of creating a priority queue. The best way to visualize a heap would be to imagine you are sitting at a desk, and your job is to file a pile of papers in front of you. You start with the first paper in the pile, then the second, then the third. However during your filing, your boss comes in and says that a big client just called and needs his file done as soon as possible. Naturally, even though the client’s file was added last to your pile, it jumps ahead of all the others and becomes the first one you work on. A heap functions in a similar way, organizing data so that certain elements are given priority over others. …

James MacDonald

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store