//f + (t -f) * a
function interpolateTriangleSide(from, to, mouse)
{
var percentY = (mouse.y - to.y) / (from.y - to.y);
console.log(percentY);
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
INSERT INTO `student` VALUES('S10345', 'John Smith', 'BSc Computer Science'); | |
INSERT INTO `student` VALUES('S10346', 'Sian Evans', 'BSc Computer Science'); | |
INSERT INTO `student` VALUES('S10347', 'Sean Crossan', 'BSc Electronic Engineering'); | |
INSERT INTO `student` VALUES('S10348', 'Jamie McDonald', 'BSc Mathematics'); | |
INSERT INTO `module` VALUES('CS101', 'Introduction to Computing', 10); | |
INSERT INTO `module` VALUES('CS203', 'Data Structures and Algorithms', 10); | |
INSERT INTO `module` VALUES('CS204', 'Computer Architecture', 10); | |
INSERT INTO `module` VALUES('M101', 'Foundation Mathematics', 20); |
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
-- Question #1 | |
SELECT `name`, `date_of_birth` | |
FROM `moviedata`.`actor` | |
WHERE `name` LIKE '% B%'; | |
-- Question #2 | |
SELECT `title`, `gross_earnings` | |
FROM `moviedata`.`film` | |
WHERE `gross_earnings` > 100000000 | |
AND `gross_earnings` < 300000000 |
Complex queries for the Advanced Java programming assignment.
/*!
* Benjamin Williams <[email protected]>
* Liam Chapman <[email protected]>
!*/
// three letter words that contain only vowels
/[aeiouAEIOU]{3}/g
// three letter words that start with a vowel and end with a vowel, but have a consonant in the middle
/[aeiouAEIOU][^aeiouAEIOU\s][aeiouAEIOU]/g
// four letter words that have a consonant at the second letter but only vowels elsewhere [4 marks];
First 100 words:
>>> text6[:100]
['SCENE', '1', ':', '[', 'wind', ']', '[', 'clop', 'clop', 'clop', ']', 'KING', 'ARTHUR', ':', 'Whoa', 'there', '!', '[', 'clop', 'clop', 'clop', ']', 'SOLDIER', '#', '1', ':', 'Halt', '!', 'Who', 'goes', 'there', '?', 'ARTHUR', ':', 'It', 'is', 'I', ',', 'Arthur', ',', 'son', 'of', 'Uther', 'Pendragon', ',', 'from', 'the', 'castle', 'of', 'Camelot', '.', 'King', 'of', 'the', 'Britons', ',', 'defe
ator', 'of', 'the', 'Saxons', ',', 'sovereign', 'of', 'all', 'England', '!', 'SOLDIER', '#', '1', ':', 'Pull', 'the', 'other', 'one', '!', 'ARTHUR', ':', 'I', 'am', ',', '...', 'and', 'this', 'is', 'my', 'trusty', 'servant', 'Patsy', '.', 'We', 'have', 'ridden', 'the', 'length', 'and', 'breadth', 'of', 'the', 'land', 'in']
>>>
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
navigator.geolocation.getCurrentPosition(function(loc) | |
{ | |
var lat = loc.coords.latitude; | |
var long = loc.coords.longitude; | |
var acc = loc.coords.accuracy; | |
console.log(lat + ", " + long + ", " + acc); | |
}); |
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
$(document).ready(function() | |
{ | |
//var articlesURL = "http://data.bbc.co.uk/bbcrd-juicer/articles.json?apikey=YB0MY3VMHyllzPqEf5alVj5bUvGpvDVi"; | |
var articlesURL = "http://data.test.bbc.co.uk/v1/bbcrd-newslabs/creative-works?point=53.38,-1.47&radius=15km&limit=5&apikey=YB0MY3VMHyllzPqEf5alVj5bUvGpvDVi"; | |
$.ajax({ url: articlesURL }).done(function(data) | |
{ | |
//articles: | |
console.log(data["@graph"]); |
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
{ | |
"data": [ | |
"a", | |
"about", | |
"above", | |
"across", | |
"after", | |
"again", | |
"against", | |
"all", |