Skip to content

Instantly share code, notes, and snippets.

nicknapoli82 /
Last active Apr 14, 2021
Everything in c is a pointer!

Everything in C is a pointer!

That’s right. I’m making this statement. This little write-up is an attempt at explaining how any why everything in the c programming language is actually just a pointer. This is simply an attempt at explaining how memory in the computer is arranged in a narrowed view and my real goal is to consider the most simple examples possible.

I will be focusing on x86 specifically.

Types in c (bits and bytes) - and pointers

I would feel pretty confident that you, by now, understand that the types in c are simply identifiers in how much space is used to represent a number. I have no interest in explaining the difference between signed vs unsigned integers. Nor am I going to explain how floating point numbers are represented. If you are interested in those things take a look at these two links. C data types and [[

nicknapoli82 /
Last active Apr 16, 2021
My attempt at clarifying how cycles work for the Tideman algorithm

A Way to Look at Tideman Lock Pairs

I've observed that there is a little bit of a disconnect in understanding what it is that needs to be done to properly implement the lock_pairs function for cs50 Tideman. The goal of this little write-up is simply an attempt at explaining what the problem actually is, and why a cycle imposes a problem.

If you are unfamiliar with the actual problem, or have not read through the entire cs50 Tideman problem description. Then I think you should start there.
cs50 Tideman

This little write-up is only narrowing in on the idea of cycles, and a way to think about what a cycle is and determine if locking a pair in the pairs array would create that cycle. This does not talk about any other part of the Tideman problem.

mjackson / FirebaseStateMixin.js
Last active Feb 5, 2016
A simple mixin for React components that need to bind state to a Firebase ref
View FirebaseStateMixin.js
var Firebase = require('firebase');
var baseRef = new Firebase('');
function getSnapshotValue(snapshot) {
return snapshot.val();
* A mixin for components that want to bind the value of a state variable
* to the value at a Firebase ref.