One of my mentors recommended that I read a book by Stanford mathematics professor G. Poyla titled “How To Solve It” and I’m going to take notes for you from the book. First, we have to understand the problem. What is the unknown? What are the data inputs? Can you restate the problem in your… Continue reading The Poyla Approach To Problem Solving
Blog
Probability Of Poker Winners
In the last blog post, I provided an intro to poker combinatorics. Now I’d like to take it a step further and deep dive into the math to determine the probability of winning hands like two pairs and royal flushes. We’re assuming a 52-card deck for this math. The probability of gaining a pair of… Continue reading Probability Of Poker Winners
Poker And Combinatorics
Probability rocks because it helps us make predictions about the future based on past data. As a pretty good poker player, probability allows me to track patterns to predict a range of hands that my opponents might have. In No Limit Texas Hold ‘Em, Doyle Brunson wrote a book a while back called the Super… Continue reading Poker And Combinatorics
Why Data Structures?
When I started to become a programmer, I always wondered what’s the big deal about data structures. It kind of seemed like some abstract mumbo jumbo that you only need to know for job interviews. As I’ve been exposed to more software development, my horizons have been expanded to the importance of data structures. For… Continue reading Why Data Structures?
The Big O
The problem with measuring functions with timers is that different machines record different times; even the same machine records different times. Furthermore, as algorithms get faster, speed measurements are typically not precise enough. So rather than counting time, it’s better to count the number of simple operations that the computer has to perform. And this… Continue reading The Big O
What The Heck Is The Difference Between A Python Interpreter and Python Compiler?
Holy moly this is a loaded (no pun intended) question. So let’s start by making this as simple as possible by understanding how computers work in general. I bought a brand new MacBook Air that came with an M1 core processor and the job of a processor is to execute machine code (binary code in… Continue reading What The Heck Is The Difference Between A Python Interpreter and Python Compiler?
Under The Hood Of Node JS
Node is a Javascript server-side runtime; it’s not a framework, a library or a language. Although Javascript’s Google V8 engine works as a single-threaded compiler, Node is asynchronous in nature and built on callback functions and promises as a non-blocking I/O built on an event loop called lubUv. In some ways, Node works similar to… Continue reading Under The Hood Of Node JS
Behind The Scenes Of addEventListener
The event listener is an asynchronous event and goes to the web API and not directly to the JS call stack. When an event that is attached to an addEventListener fires, the event handler addEventListener causes the web API in the browser to set-up a macrotask event queue in the event loop. This event macrotask… Continue reading Behind The Scenes Of addEventListener
The Power Of Closure
I feel like closure is one of the most difficult things to understand in Javascript. Let’s try to break this down into a more digestible concept. In JS, functions are objects and can be declared anywhere. If I declare a function within another function, the inner function has access to the local variable of the… Continue reading The Power Of Closure
A Prototype Chain By Any Other Name Would Smell As Sweet…
Javascript, I love it when you talk prototypes and chains at me… But JS, I know you’re lying to me. You really don’t have classes like in other OOP (object oriented programming) languages. When we code, we’re really only concerned about two things: storing data in memory and applying functionality to this data. Object Oriented… Continue reading A Prototype Chain By Any Other Name Would Smell As Sweet…