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
// | |
// colours.h | |
// COMP1917 | |
// | |
// Created by Nick Robson on 20/03/2015. | |
// Copyright (c) 2015 Nick Robson. All rights reserved. | |
// | |
#ifndef __COMP1917__colours__ | |
#define __COMP1917__colours__ |
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> | |
int main(int argc, char* argv[]) { | |
char fileName[30]; | |
printf("Enter file name: "); | |
scanf("%s", fileName); | |
FILE* file = fopen(fileName, "r"); |
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
tridentsdk="TridentSDK" | |
trident="Trident" | |
env="Env" | |
clear | |
# Print 'header' info | |
echo "\x1b[35;1m====================================" | |
echo "== Trident Workspace Fetcher v2.0 ==" | |
echo "====================================" |
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
function convert(num) { | |
var map = [ | |
[1, 1, 'I'], | |
[1, 5, 'V'], | |
[2, 10, 'X'], | |
[2, 50, 'L'], | |
[3, 100, 'C'], | |
[3, 500, 'D'], | |
[4, 1000, 'M'], | |
[4, 5000, ''], |
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
def number_shuffle(number) | |
dig = number.to_s.split '' | |
if dig.length == 1 | |
return dig | |
end | |
out = [] | |
(0...dig.length).each do |d| | |
nums = [] | |
if d > 0 | |
nums = nums << dig[0..d-1] |
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
import sys | |
import time | |
import urllib | |
import urllib2 | |
import bs4 | |
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0'} | |
def scrape(id): | |
req = urllib2.Request('http://www.strawpoll.me/%s' % id, headers=headers) |
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 <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
#define I2C_ADDR 0x3F | |
#define TEMP_SENSOR A0 | |
LiquidCrystal_I2C lcd(I2C_ADDR, 20, 4); | |
void setup() { |
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
#!/usr/bin/env python | |
import re | |
import urllib2 | |
import bs4 | |
BASE_URL = 'http://www.bbc.co.uk/news/politics/eu_referendum/results/local/' | |
VOTES = re.compile(r'[0-9]+(?:,[0-9]+)*') | |
def get_urls(): |
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
#!/usr/bin/env python | |
import re | |
import urllib2 | |
import bs4 | |
BASE_URL = 'http://www.bbc.co.uk/news/politics/eu_referendum/results/local/' | |
VOTES = re.compile(r'[0-9]+(?:,[0-9]+)*') | |
def get_urls(): |
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
package ass1; | |
public class MyCoolGameObject extends GameObject { | |
public MyCoolGameObject() { | |
super(GameObject.ROOT); | |
new PolygonalGameObject(this, new double[] {0, 0, 0, .5, .5, .5, .5, 0}, new double[] {1, 0, 0, .5}, null); | |
new LineGameObject(this, 0, 0, 1, 0, new double[] {0, 1, 0, .5}); | |
new LineGameObject(this, 0, 0, 0, 1, new double[] {0, 1, 0, .5}); |
OlderNewer