This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
//////////////////////////////////////////////////////////////////////// | |
// Fake version of pokedex.c // | |
//////////////////////////////////////////////////////////////////////// | |
// Pretend this takes in a pokedex... | |
void detail_pokemon(void) { | |
printf("Id: #001\n"); | |
printf("Name: Bulbasaur\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Set up some sensible defaults: | |
# firefox - web browser | |
# Thunar - file manager | |
# xfce-terminal - terminal | |
# gedit - C source files | |
# eog - bitmaps | |
# Relevant files where config settings are stored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MANDEL_MIN = -2 | |
MANDEL_MAX = 2 | |
MANDEL_WIDTH = 4.0 # abs(MANDEL_MIN) + abs(MANDEL_MAX) | |
""" | |
Tile coords look like: for n=4 | |
(0,0) (1,0) (2,0) (3,0) | |
(0,1) (1,1) (2,1) (3,1) | |
(0,2) (1,2) (2,2) (3,2) | |
(0,3) (1,3) (2,3) (3,3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
struct student { | |
char name[100]; | |
int age; | |
}; | |
struct student make_student() { | |
struct student cur_student; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Andrew Bennett <andrew.bennett@unsw.edu.au> | |
# April 2017 | |
# Hacky script to generate my possible timetables for next semester, | |
# eliminate any that don't meet my requirements, then rank them in | |
# order of "goodness". | |
import json | |
import random | |
import operator | |
import itertools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Determine the resolution for a series of VNC ports. | |
Andrew Bennett <andrew.bennett@unsw.edu.au> | |
Feb 2017 | |
Implementing the protocol from the RFC6143 spec: | |
https://tools.ietf.org/html/rfc6143 | |
Width and Height: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delete an item from a hash table that uses linear probing to deal with collisions. | |
void delete(HashTable ht, Key k) { | |
int numSlots = ht->nslots; | |
Item *data = ht->items; // the actual hash table | |
int i; // i is a better counter variable name than j | |
int hashPos = hash(k, numSlots); // the position in the hash table | |
// probe through the possible slots it could be, | |
// starting from the value it actually hashed to, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Looking at variable: str1[] | |
&str1[]: -> 0xfff42d72 (address) | |
str1[]: -> 0xfff42d72 (value) | |
*str1[]: -> 0x41 (dereference) | |
Looking at variable: str2[] | |
&str2[]: -> 0xfff42d77 (address) | |
str2[]: -> 0xfff42d77 (value) | |
*str2[]: -> 0x41 (dereference) | |
Looking at variable: strp1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A script to take a screenshot, save to a file *and* copy to clipboard. | |
# Because gnome-screenshot can't do both. | |
# Assumes you have `gnome-screenshot` and `xclip` installed | |
# Andrew Bennett <andrew.bennett@unsw.edu.au> 2016-11-05 | |
USERNAME=$(whoami) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SONG_BPM 145 | |
/* | |
// Track 3: | |
uint16_t notes[] = { | |
82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 123, 131, 147, 73, 73, 73, 110, 87, 65, 131, 131, 65, 98, 98, 123, 247, 247, 165, 208, 110, 165, 110, 165, 110, 165, 82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 123, 131, 147, 73, 73, 73, 110, 87, 65, 131, 131, 65, 98, 98, 123, 247, 247, 165, 208, 110, 165, 110, 165, 110, 165, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, |
NewerOlder