“The only reason for time is so that everything doesn’t happen at once.” — Albert Einstein
An early mentor at one of my internships gave me the advice to “Think Longer”. It might be the best piece of advice I failed to take seriously.
During university, life happened in 4 month increments.
Every 4 months alternated between school and internships. Thinking ahead meant considering the next term before it happened. During a school term, you would interview for your internships, and during the internship you would pick your classes for the next term.
This made life rather simple. At the…
Largest Palindrome Product
I broke this problem into 3 smaller sub-problems.
The first is taking an integer and breaking it into its digits. I wrestled with this for a little while but ended up with an elegant function using integer division.
The second is to determine if a number is a palindrome. Once I used the first function to break the number apart, it was fairly straight-forward to compare first and last digits, moving towards the center, and determining if they were the same number (ie a palindrome).
Largest Prime Factor
This one was very useful if you have some math background.
Any non-prime number can be represented as the multiple of its prime factors, meaning for example, 21 = 3 x 7 or 1,234,567,890 = 2 x 3 x 5 x 3607 x 3803.
A simple way to determine the prime factors of a number is the following algorithm:
Set k = 2.
Check if the number is divisible by k. If so, the new number becomes old number divided by k.
Increase k by 1. …
Even Fibonacci Numbers
First step is to create a function that produces all the Fibonacci numbers.
I am fortunate to have seen someone else’s brilliant solution to this problem:
a = first number
b = second number
c = a + b
a = b
b = c
Repeat as needed.
This is a great solution because it doesn’t store each Fibonacci number, taking up memory, it simply calculates each Fibonacci number from the previous two and overwrites past values.
Step two is two add a criteria to…
The First of Many
I’ve decided to program more often.
I’ve also said that many times before.
However, I think I finally found something that will help me stick with the habit: a huge collection of puzzles.
As far back as I can remember, I have loved solving puzzles. I think that’s a big reason why I was so successful in the maths and sciences in school and decided to go into engineering: it’s all one big puzzle.
But programming is a skill I have fallen behind on. I’ve read at least one book on Python and done most of…
Thoughts on Skill Sets Outside of the Domain
I recently had a conversation with a VFC member has had completed Training Camp and is about to head into the job market. This is their first job out of school, and they are nervous about trying to jump into a startup in the midst of a pandemic.
This individual is truly exceptional across the board: top grades at university, internship work experience, real life experience in extra-curricular activities, and has even started their own side-project company using their skills in the midst of a difficult job market.
In any other condition…
How I Wrote Better Than Ever in the Age of Social Distancing
I’ve decided to start writing more and more, and applying the lessons I learned from running to help with that. So here goes:
How I Ran Better Than Ever in the Age of Social Distancing
I have been running more during this quarantine, which I suppose started in February or March, than I have at any other period of my life.
I took a gym class in high school where I ran 2 days per week for 4 months, and have since surpassed that in both repetitions and distance.
So I’ve decided to take what I’ve learned from building a running habit and apply it here to my writing.
So how did I make the running habit sustainable? A few key things:
A Productivity Technique for Continuous Creativity
Ernest Hemingway had written that one of his methods for productivity was to stop writing when he knew what would happen next:
“When I am working on a book or a story I write every morning as soon after first light as possible. There is no one to disturb you and it is cool or cold and you come to your work and warm as you write. You read what you have written and, as you always stop when you know what is going to happen next, you go on from there. You write…
Thoughts on Taking Your Time
I recently purchased a pair of pants from MEC. The size is a little awkward, but they are extremely comfortable, and with most items from MEC, I expect them to last a long time.
However, with the weird sizing — I’m an awkwardly shaped human — the pants sometimes dig into the side of my thighs as I am walking and cause chafing.
I have found two solutions to this:
Wear long boxers, which doesn’t solve the issue, it just prolongs it.
For those who have ever done a walking meeting with me…