Posts

Showing posts from November, 2021

Thinking about fuzzy logic and implementing black boxes

Today, Google did a doodle about Dr. Lotfi Zadeh who published a paper that proposed fuzzy logic. It feels like it's been forever since I studied anything that has to do with machine learning so I decided why not, let me learn a bit about this. It turns out, fuzzy logic is actually really applicable to my job (which involves no machine learning at all) not because I need to implement a bunch of ambiguous things on the app (although dealing with ambiguity is a big part of the job) but it proposes a really neat way to think about constructing a black box. First, my understanding of a fuzzy system. It is effectively a black box, with rules that you can configure. You feed in your raw data on one end, it goes through the "fuzzifier", the "inference engine", the "defuzzifier" and some new data emerges from the other end. The core of this box is the inference engine. Basically, this part of the system holds the rules that you and your product folks come up w...

Scary Spookvember: Regex!

Image
This is the first blog post in a new series of blog posts that involves me learning and blogging about things that scare developers. I came up with this idea basically right after Halloween ended, so unfortunately this has to be the Scary Spookvember series now instead of Spooktober, which would've made more sense 🤦. This first article is about Regex. Many developers think of it as like a template that can match strings, but actually, Regex is a simple programming language! To show this, let's take a look at a simple Regex that matches a simple lowercase UUID, such as e81dd3ba-44bb-11ec-81d3-0242ac130003 . The Regex that I found on stack overflow is: \b([0-9a-f]){8}-([0-9a-f]){4}-([0-9a-f]){4}-([0-9a-f]){4}-([0-9a-f]){12}\b At first glance, this looks quite confusing and scary, but once we reformat it a bit, things begin to start taking shape: \b # match the beginning or end of a word ( [0-9a-f] # match any character from 0-9 or a-f ) {8} # loop 8 times - # match the...