Skip to content

Instantly share code, notes, and snippets.

View thomafred's full-sized avatar

Thomas Li Fredriksen thomafred

View GitHub Profile
@thomafred
thomafred / Pi Fractal.ipynb
Created March 18, 2019 12:04
A simple article on how to compute Pi from the Mandelbrot-set
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thomafred
thomafred / Bridges of Königsberg in Neo4j.md
Last active March 14, 2019 07:43
A simple article on solving the "Bridges of Königsberg"-problem using Neo4j

Introduction

This city of Königsberg, (now Kaliningrad, Russia) in Prussia as set on the river Pregel, and included two islands: Kneiphof and Lomse, connected by a single bridge. Lomse, the east-most island of the two, were connected to the north and south bank by a single bridge on each bank, while Kneiphof were connected by bridges on either bank.

Königsberg 18th Century

During the first half of the 18th century, a popular problem among mathematicians in the city were to determine whether it was possible to traverse all bridges exactly once without jumping in the water. Swiss mathematician Leonhard Euler finally provided a general solution to the problem in 1736, laying the foundation to Graph-Theory in his paper published in Commentarii academiae scientiarum Petropolitanae, 1741.

In this short article, we will attempt to prove

@thomafred
thomafred / CMakeLists.txt
Created October 23, 2017 09:39
SPIFFS CMakeLists.txt
#
# SPIFFS library
#
# Author: Peter Andersson
# https://github.com/pellepl
#
# CMakeLists.txt Author: Thomas Li Fredriksen
# thomas@continyou.no
#
# https://github.com/pellepl/spiffs
@thomafred
thomafred / switch.py
Last active April 20, 2017 13:48
Python switch-statement implementation
"""Python switch-statement pseudo-implementation
Mimics C-style switch statements
The following code blocks should be equivalent
-----------------------------------------------
switch(arg):
case 1:
// Handle case
case 2:
// Handle case
default: