Battle of Algiers

Incredible film about the political conflict in Algeria:

How to make Preview the Default Application for Opening PDFs instead of Adobe (MacOS)

Ever since I downloaded Adobe Acrobat Reader, I noticed that all my PDFs open with Adobe, which I did not prefer as I liked the Preview interface.

In order to make preview the default app for opening pdf files, you can right click a PDF file in Finder/Desktop, and then press Get Info. Then, it will show some details. Open the drop down that says Open With: and set it to Preview. Then, press Change All. Now, whenever you open a PDF, it will always open in Preview.

Two’s Complement

Explanation of two’s complement:


Take binary digits, flip them all, then add 1

To undo two’s complement: -1 from binary digit, flip all digits, convert

KMeans Clustering

Since I’m currently doing KMeans Clustering for my AI class, here are some resources I found helpful:


Example code of kMeans segmentation: 

Segmentation using k-means clustering in Python

Image Segmentation using KMeans:

Open CV Tutorial:

Open CV Full Tutorial with Python: 


K-fold Cross Validation

I had some confusions in my AI class regarding how k-fold cross validation worked, and I found this very concise and clear explanation for it:


How to rename an iOS project in XCode

Renaming a project in XCode can be a hassle and cause a lot of complications and problems if not done correctly because there are a lot of root files and embedded files that must be renamed as well. So how can you easily rename a project in XCode?

The following tutorial shows you how to do it within 3 minutes and I found it very helpful:

The only discrepancy I found in that tutorial (made in 2019) and Xcode version today (2021) is that I don’t believe the current version has an option to rename the “Development Assets” under Deployment, but everything else is the same.

Best of luck!

Constraint Satisfaction Problems (CSP)

Constraint Satisfaction Problem


    • Search problem
    • Care about the goal itself: state is a black blox, implemented as some data structure
    • Goal test: function over the states, set of constraints specifying allowable combinations of values for subset of variables
    • Main 3 elements of CSP:
  1. Set of variables
  2. Set of domains for each variable
  3. Set of constraints