Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added KeshanPeiris/week_01/cats.js
Empty file.
2 changes: 1 addition & 1 deletion KeshanPeiris/week_01/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset= "UTF-8">
<title> Document </title>
<script src="week_01/warmup2week1.js"> </script>
<script src="mta.js"> </script>
</head>
<body>
<h2> Please open the console to see the output </h2>
Expand Down
86 changes: 86 additions & 0 deletions KeshanPeiris/week_01/mta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// planTrip('N', 'Times Square', '6', '33rd'); // This is only a suggested function name and signature.

// // console.log() shows output similar to this:
// // "Your must travel through the following stops on the N line: 34th, 28th, 23rd, Union Square."
// // "Change at Union Square."
// // "Your journey continues through the following stops: 23rd, 28th, 33rd."
// // "7 stops in total."
// There are 3 subway lines:
// The N line has the following stops: Times Square, 34th, 28th, 23rd, Union Square, and 8th
// The L line has the following stops: 8th, 6th, Union Square, 3rd, and 1st
// The 6 line has the following stops: Grand Central, 33rd, 28th, 23rd, Union Square, and Astor Place.
// All 3 subway lines intersect at Union Square, but there are no other intersection points. (For example, this means the 28th stop on the N line is different than the 28th street stop on the 6 line, so you'll have to differentiate this when you name your stops in the arrays.)
// Tell the user the number of stops AND the stops IN ORDER that they will pass through or change at.
// Hints:

// Work out how you would do it on paper first! Then start to explain that process in Javascript.
// Get the program to work for a single line before trying to tackle multiple lines.
// Don't worry about prompting the user for input. Hard code some values to get it working. You can use prompt() later to make it more interactive.
// Consider diagramming the lines by sketching out the subway lines and their stops and intersection.
// The key to the lab is finding the index positions of each stop. (hint: indexOf())
// Make sure the stops that are the same for different lines have different names (i.e. 23rd on the N and on the 6 need to be differentiated)
// var planTrip = function ( linea , start, lineb, finish) {

// }
// var lineN = new lineN['timessquare', '34th', '28th', '23rd', 'unionsquare', '8th' ];
// var lineL = new lineL['8thL', '6th', 'unionsquareL', '3rd','1st'];
// var line6 = new line6['grandcentral', '33rd', '28th6', '23rd','unionsquare6', 'astorplace'];
// var mtaNetwork = new mtaNetwork[ lineN , lineL, line6 ];

var lineN = ['timessquare', '34th', '28th', '23rd', 'unionsquare', '8th' ];
var lineL = ['8thL', '6th', 'unionsquareL', '3rd','1st'];
var line6 = ['grandcentral', '33rd', '28th6', '23rd6','unionsquare6', 'astorplace'];
var mtaNetwork = lineN.concat(lineL, line6)

var planTrip = function (startstation, endstation ){
for (var i = 0; i < mtaNetwork.length; i++) {
var travel = mtaNetwork[i] ;
if (travel === startstation && endstation ){
console.log("we made it to " + endstation + " from "+ startstation + " we have moved "+ (mtaNetwork.indexOf(endstation) - (mtaNetwork.indexOf(startstation))) + " spots")
} else {
("we didnt make it")
}
};
}

// var planTrip = function (lineA, lineB) {
// for (var i = 0; i < lineN.length; i++) {
// var travel = lineN[i];
// if (lineN[i] === lineA && lineB) {
// console.log("we made it to " + lineB+ " from "+ lineA + " we have moved "+ (lineN.indexOf(lineB) - (lineN.indexOf(lineA))) + " spots")
// // } else if (lineN[i] !== lineA && lineB){
// // for (var i = 0; i < lineL.length; i++) {
// // lineL[i]
// // var travel2 = LineL[i];
// // if (lineL[i]= lineA||lineB){
// // console.log("we made it to"+ lineB + " from " + lineA + " We switched stations at union square!")

// // }



// // };
// }

// };
// }




















14 changes: 14 additions & 0 deletions KeshanPeiris/week_02/display/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

.container {
max-width: 960px;
margin: auto;
}

.box {
width: 300px;
height: 300px;
border: 1px solid black;
text-align: center;
line-height: 300px;

}
19 changes: 19 additions & 0 deletions KeshanPeiris/week_02/display/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="container">
<h1>This is the css positioning demo </h1>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cupiditate, tempora. Dolore nesciunt, accusantium, aut, distinctio animi adipisci reprehenderit autem nobis odit eligendi unde voluptas quas, eaque facilis veniam ipsa quasi!</div>
<div>Nostrum tempora similique asperiores optio quia consectetur cupiditate deleniti esse incidunt omnis iure, corrupti quaerat vitae, minus quo et vero nihil aspernatur ea officia soluta. Sunt autem doloribus deleniti natus.</div>
<div>Nostrum beatae architecto rerum ducimus sunt quia amet voluptatum itaque, provident quidem. Magni tempora eos, voluptatibus amet quisquam vel incidunt unde laborum in, eligendi itaque mollitia earum! Nam, minus maiores?</div>
<div>Expedita odit, corrupti adipisci, praesentium exercitationem nihil, optio mollitia a repellat inventore ipsam error! Dolorum autem, ex! Delectus nulla nam natus ab, eligendi eaque soluta odio at laborum molestiae nisi.</div>
</div>
<div class="box"> default</div>

</body>
</html>
Empty file added KeshanPeiris/week_02/friday.js
Empty file.
11 changes: 11 additions & 0 deletions KeshanPeiris/week_02/friday/fridaywarm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>

</body>
</html>
<script type="text/javascript"src="fridaywarm.js"></script>
66 changes: 66 additions & 0 deletions KeshanPeiris/week_02/friday/fridaywarm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// DNA is represented by an alphabet of the following symbols: 'A', 'C', 'G', and 'T'.

// Each symbol represents a nucleotide, which is a fancy name for the particular molecules that happen to make up a large part of DNA.

// Shortest intro to biochemistry EVAR:

// twigs are to birds nests as
// nucleotides are to DNA and RNA as
// amino acids are to proteins as
// sugar is to starch as
// oh crap lipids
// I'm not going to talk about lipids because they're crazy complex.

// So back to nucleotides.

// There are 5 types of nucleotides. 4 of these occur in DNA: A, C, G, and T. 4 occur in RNA: A, C, G, U.

// There are no other nucleotides.

// Make sure that you validate it has nucleotides!

// Find how many of each nucleotides are in a string that you pass in to a function
var nucleotides = {
count:function(string,nucleotide){
var nucleotideCount = 0;
string = string.split('');

for (var i = 0; i < string.length; i++) {
var character = string[i]
if (character === nucleotide) {
nucleotideCount += 1 ;
}
};
return nucleotideCount;


},
countAll: function (string){
// var aCount = nucleotides.count(string, "A");
// var cCount = nucleotides.count(string, "C");
// var gCount = nucleotides.count(string, "G");
// var tCount = nucleotides.count(string, "T");
// var uCount = nucleotides.count(string, "U");
return {
"A": aCount,
"C": cCount,
"T": tCount,
"G": gCount,
"U": uCount
}
}
}














20 changes: 20 additions & 0 deletions KeshanPeiris/week_02/htmlcss/intro/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
h1 {
text-align: center;
font-family: helvetica;
color: black;
font-size: 50px;
text-shadow: 0 0 10px red;
}
body{
background-color: #B2FFD6;
}
p{
color: purple;
margin-left: 10px ;

}
p.vital {
font-size: 150%;
color: blue ;

}
45 changes: 45 additions & 0 deletions KeshanPeiris/week_02/htmlcss/intro/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!doctype html>
<html>
<head>
<title> HTML intro </title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>


<body>
<h1> Welcome to the tedious HTML intro! </h1>
<h2> less important</h2>
<h3> less </h3>
<h4> less</h4>
<h5> less</h5>
<h6> less </h6>
any <strong>old</strong> <em> text </em>.

<p>here is some more text</p>
<p> link example :<a href="http://ga.co/" target="_blank">click me</a>. </p>
<p class="vital"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<img src="http://barkpost.com/wp-content/uploads/2014/12/funny-dog-fail-picturesdog-fail-failfun-dlp0vrzz.jpg">
<div>
<h2>marx brothers</h2>
<ul>
<li> grouch </li>
<li> harpo </li>
<li> chico </li>
</ul>

<ol>
<li> grouch </li>
<li> harpo </li>
<li> chico </li>
</ol>
</div>
</body>

</html>
11 changes: 11 additions & 0 deletions KeshanPeiris/week_02/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset= "UTF-8">
<title> Document </title>
<script src="monday.js"> </script>
</head>
<body>
<h2> Please open the console to see the output </h2>
</body>
</html>
21 changes: 21 additions & 0 deletions KeshanPeiris/week_02/joelswebsite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body class="bodyentire" background="pictures/background.jpg" class="container">

<h1 class="heading">Alan Turing </h1>
<img src="http://www.rutherfordjournal.org/images/TAHC_Turing_1A.jpg" alt="" class="headerphoto">
<p> Alan Mathison Turing, OBE, FRS (/ˈtjʊərɪŋ/; 23 June 1912 – 7 June 1954) was a British pioneering computer scientist, mathematician, logician, cryptanalyst and theoretical biologist. He was highly influential in the development of computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general purpose computer.[2][3][4] Turing is widely considered to be the father of theoretical computer science and artificial intelligence.[5] </p>
<p> During the Second World War, Turing worked for the Government Code and Cypher School (GC&CS) at Bletchley Park, Britain's codebreaking centre. For a time he led Hut 8, the section responsible for German naval cryptanalysis. He devised a number of techniques for breaking German ciphers, including improvements to the pre-war Polish bombe method and an electromechanical machine that could find settings for the Enigma machine. Turing played a pivotal role in cracking intercepted coded messages that enabled the Allies to defeat the Nazis in many crucial engagements, including the Battle of the Atlantic; it has been estimated that this work shortened the war in Europe by as many as two to four years.[ </p>
<p> After the war, he worked at the National Physical Laboratory, where he designed the ACE, among the first designs for a stored-program computer. In 1948 Turing joined Max Newman's Computing Laboratory at the University of Manchester, where he helped develop the Manchester computers[7] and became interested in mathematical biology. He wrote a paper on the chemical basis of morphogenesis, and predicted oscillating chemical reactions such as the Belousov–Zhabotinsky reaction, first observed in the 1960s. </p>
<p>Turing was prosecuted in 1952 for homosexual acts, when such behaviour was still a criminal act in the UK. He accepted treatment with oestrogen injections (chemical castration) as an alternative to prison. Turing died in 1954, 16 days before his 42nd birthday, from cyanide poisoning. An inquest determined his death as suicide, but it has been noted that the known evidence is equally consistent with accidental poisoning.[8] In 2009, following an Internet campaign, British Prime Minister Gordon Brown made an official public apology on behalf of the British government for "the appalling way he was treated". Queen Elizabeth II granted him a posthumous pardon in 2013.</p>
<a href="page2.html" class="joelslink"> CLICK HERE TO SEE WHAT JOEL DONT KNOW!</a>
<a href="page3.html" class="joelslink"> WHY DOES JOEL LIKE HIM ? </a>


</body>
</html>
18 changes: 18 additions & 0 deletions KeshanPeiris/week_02/joelswebsite/page2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body class="background2" background="http://thumbs.dreamstime.com/z/abstract-blue-clean-background-copyspace-18368566.jpg">
<h1 class= "headerpage2"> Alan Turing Anagrams </h1>
<p class="page2para"> URINAL TANG </p>
<p class="page2para"> NATURAL GIN </p>
<p class="page2para"> ANAL </p>
<p class="page2para"> LUNAR GIANT </p>
<img src="https://lunaextrema.files.wordpress.com/2011/11/gnfn.png" alt=""class="imgpage2">
<img src="https://stancarey.files.wordpress.com/2013/03/futurama-fry-should-i-lol-or-roflmao.jpg" alt=""class="imgpage2">
<img src="http://lolwus.com/wp-content/uploads/2014/09/39.jpg" alt=""class="imgpage2">
</body>
</html>
19 changes: 19 additions & 0 deletions KeshanPeiris/week_02/joelswebsite/page3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body background ="http://wallpaperhdwide.com/wp-content/gallery/sample-background-images/1380265.jpg">
<h1 class="page3header"> Why does Joel like him?</h1>
<ul> Things in common (Tends to explain why they like them)
<ul>They both like machines (computing specifically)</ul>
<ul>They both have similar hair</ul>
<ul> They are both clever</ul>
<ul> They both born in the 20th century </ul>
<ul> They both prefer men</ul>
</ul>

</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading