Skip to content

Instantly share code, notes, and snippets.

View faraazahmad's full-sized avatar
🏠
Working from home

Syed Faraaz Ahmad faraazahmad

🏠
Working from home
View GitHub Profile
@faraazahmad
faraazahmad / better.py
Created December 28, 2017 14:20
an optimised fibonacci generating algorithm using memoisation
def better_fib(n):
if n >= 0 and n <= 1:
return n
else:
fib = [0, 1]
for i in range(2, n + 1):
fib.append(fib[i - 1] + fib[i - 2])
return fib[n]
@faraazahmad
faraazahmad / naive.py
Last active December 28, 2017 14:18
Simple pseudocode for naive recirsive fibonacci algorithm
def naive_fib(n):
if n >= 0 and n <= 1:
return n
else:
return naive_fib(n - 1) + naive_fib(n - 2)
@faraazahmad
faraazahmad / boot.asm
Last active July 6, 2017 16:16
error on make
global start
section .text
bits 32
start:
; point the first entry of the level 4 page table
; to the first entry in level 3 page table
mov eax, p3_table
or eax, 0b11
mov dword [p4_table + 0], eax