Skip to content

Instantly share code, notes, and snippets.

View guynan's full-sized avatar

guynan

  • Auckland, New Zealand
View GitHub Profile

Keybase proof

I hereby claim:

  • I am guynan on github.
  • I am gnan (https://keybase.io/gnan) on keybase.
  • I have a public key ASAJYBU8SZjltMRp2WWIeJkEMFExZEtP2amSq1N4ev4uxwo

To claim this, I am signing this object:

@guynan
guynan / 383.tex
Created May 12, 2019 10:47
383 Assignment
\nonstopmode
\documentclass[a4paper]{article}
%% Sets page size and margins
\usepackage[a4paper,top=1.5cm,bottom=2cm,left=2cm,right=2cm,marginparwidth=1.75cm]{geometry}
\usepackage{hyperref}
\hypersetup{
global asm_prime
section .text
; We pass in one parameter of size 64 bits
; eax is our return value.
; edi is our input value
; ebx is our counter
; ecx stores the result of the counter squared
; edx is where the remainder is stored
CFLAGS=-Wall -Wextra -O2
sqrt:
$(CC) $(CFLAGS) sqrt.c -lm -o sqrt
no-sqrt:
$(CC) $(CFLAGS) no-sqrt.c -o no_sqrt
CC=gcc
SRC=fixed.c
all:
$(CC) -Wall -Wextra -g $(SRC) -lm -lpthread -O2
@guynan
guynan / This.py
Last active October 18, 2016 05:33
# Change it up a bit.
def converter(number,base):
f = [1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f"]
if number > 0:
return str(converter(number//base, base)) + str(f[int(number%base)]);
else:
return "";
#!/bin/python3
"""
This program simulates
throwing four coins 200 times.
Here, the 'Heads' is modelled as
a 1, and tails 0.
"""
import random