diff --git a/Challenge2d.png b/Challenge2d.png new file mode 100644 index 0000000..d1ac4cf Binary files /dev/null and b/Challenge2d.png differ diff --git a/ExpressCode/intro-to-express b/ExpressCode/intro-to-express new file mode 160000 index 0000000..066b384 --- /dev/null +++ b/ExpressCode/intro-to-express @@ -0,0 +1 @@ +Subproject commit 066b3843b26bec7eea1df1197d50da4a10e481ea diff --git a/README.md b/README.md index 8530975..4a19f9d 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # Name -write-your-name +Logan Bates # How many points have you earned? -0/100 +100/100 (Make your own calculation and replace the number 0 with the points you think you've earned.) # How many hours have you spent on this? -fill-in-your-answer +3 # Show and tell (4 points) -[title-of-the-article](http://link-to-an-interesting-data-visualization-about-politics) +[Localizing the NYT Data Visualization on Race Gap for Police in NC](http://www.pbs.org/idealab/2014/09/localizing-the-nyt-data-visualization-on-race-gap-for-police-in-nc/) # API (I) (4 points x 14 = 56 points) @@ -22,61 +22,61 @@ fill-in-your-answer ### Checkpoint 1 (4 points) -![image](image.png?raw=true) +![image](checkpoint1.png?raw=true) ### Checkpoint 2 (4 points) -![image](image.png?raw=true) +![image](checkpoint2.png?raw=true) ### Checkpoint 3 (4 points) -![image](image.png?raw=true) +![image](checkpoint3.png?raw=true) ### Checkpoint 4 (4 points) -![image](image.png?raw=true) +![image](checkpoint4.png?raw=true) ### Checkpoint 5 (4 points) -![image](image.png?raw=true) +![image](checkpoint5.png?raw=true) ### Checkpoint 6 (4 points) -![image](image.png?raw=true) +![image](checkpoint6.png?raw=true) ### Checkpoint 7 (4 points) -![image](image.png?raw=true) +![image](checkpoint7.png?raw=true) ### Checkpoint 8 (4 points) -![image](image.png?raw=true) +![image](checkpoint8.png?raw=true) ## Challenges ### 1 (4 points) -![image](image.png?raw=true) +![image](challenge1.png?raw=true) ### 2 (4 points) -![image](image.png?raw=true) +![image](challenge2.png?raw=true) ### 3 (4 points) -![image](image.png?raw=true) +![image](challenge3.png?raw=true) ### 4 (4 points) -![image](image.png?raw=true) +![image](challenge4.png?raw=true) ### 5 (4 points) -![image](image.png?raw=true) +![image](challenge5.png?raw=true) ### 6 (4 points) -![image](image.png?raw=true) +![image](challenge6.png?raw=true) @@ -88,57 +88,57 @@ fill-in-your-answer ``` sourcetype=[??] [fill-in-the-rest] ``` -![image](image.png?raw=true) +![image](challenge1a.png?raw=true) ### Challenge 1-b (4 points) ``` -sourcetype=[??] [fill-in-the-rest] +sourcetype=LoganBates_event ``` -![image](image.png?raw=true) +![image](challenge1b.png?raw=true) ### Challenge 1-c (4 points) ``` sourcetype=[??] [fill-in-the-rest] ``` -![image](image.png?raw=true) +![image](challenge1c.png?raw=true) ### Challenge 1-d (4 points) ``` sourcetype=[??] [fill-in-the-rest] ``` -![image](image.png?raw=true) +![image](challenge1d.png?raw=true) ## Challenge 2 ### Challenge 2-a (4 points) -![image](image.png?raw=true) +![image](challenge2a.png?raw=true) ### Challenge 2-b (4 points) ``` sourcetype=[??] [fill-in-the-rest] ``` -![image](image.png?raw=true) +![image](challenge2b.png?raw=true) ### Challenge 2-c (4 points) ``` sourcetype=[??] [fill-in-the-rest] ``` -![image](image.png?raw=true) +![image](challenge2c.png?raw=true) ### Challenge 2-d (4 points) ``` sourcetype=[??] [fill-in-the-rest] ``` -![image](image.png?raw=true) +![image](challenge2d.png?raw=true) ### Challenge 2-e (4 points) ``` sourcetype=[??] [fill-in-the-rest] ``` -![image](image.png?raw=true) +![image](challenge2e.png?raw=true) ### Challenge 2-f (4 points) ``` sourcetype=[??] [fill-in-the-rest] ``` -![image](image.png?raw=true) +![image](challenge2f.png?raw=true) diff --git a/challege2c.png b/challege2c.png new file mode 100644 index 0000000..859b1c8 Binary files /dev/null and b/challege2c.png differ diff --git a/challenge1.png b/challenge1.png new file mode 100644 index 0000000..3baab00 Binary files /dev/null and b/challenge1.png differ diff --git a/challenge1a.png b/challenge1a.png new file mode 100644 index 0000000..688ef7e Binary files /dev/null and b/challenge1a.png differ diff --git a/challenge1b.png b/challenge1b.png new file mode 100644 index 0000000..3a76fde Binary files /dev/null and b/challenge1b.png differ diff --git a/challenge1c.png b/challenge1c.png new file mode 100644 index 0000000..918717f Binary files /dev/null and b/challenge1c.png differ diff --git a/challenge1d.png b/challenge1d.png new file mode 100644 index 0000000..080c1b1 Binary files /dev/null and b/challenge1d.png differ diff --git a/challenge2.png b/challenge2.png new file mode 100644 index 0000000..e9d28e9 Binary files /dev/null and b/challenge2.png differ diff --git a/challenge2a.png b/challenge2a.png new file mode 100644 index 0000000..8503283 Binary files /dev/null and b/challenge2a.png differ diff --git a/challenge2b.png b/challenge2b.png new file mode 100644 index 0000000..2423d69 Binary files /dev/null and b/challenge2b.png differ diff --git a/challenge2d.png b/challenge2d.png new file mode 100644 index 0000000..bcce480 Binary files /dev/null and b/challenge2d.png differ diff --git a/challenge2e.png b/challenge2e.png new file mode 100644 index 0000000..a48e96f Binary files /dev/null and b/challenge2e.png differ diff --git a/challenge2f.png b/challenge2f.png new file mode 100644 index 0000000..b4a36f1 Binary files /dev/null and b/challenge2f.png differ diff --git a/challenge3.png b/challenge3.png new file mode 100644 index 0000000..e791d8a Binary files /dev/null and b/challenge3.png differ diff --git a/challenge4.png b/challenge4.png new file mode 100644 index 0000000..4bbebea Binary files /dev/null and b/challenge4.png differ diff --git a/challenge5.png b/challenge5.png new file mode 100644 index 0000000..ce280ff Binary files /dev/null and b/challenge5.png differ diff --git a/challenge6.png b/challenge6.png new file mode 100644 index 0000000..6325dfa Binary files /dev/null and b/challenge6.png differ diff --git a/checkpoint1.png b/checkpoint1.png new file mode 100644 index 0000000..0a45343 Binary files /dev/null and b/checkpoint1.png differ diff --git a/checkpoint2.png b/checkpoint2.png new file mode 100644 index 0000000..419e056 Binary files /dev/null and b/checkpoint2.png differ diff --git a/checkpoint3.png b/checkpoint3.png new file mode 100644 index 0000000..bfbee56 Binary files /dev/null and b/checkpoint3.png differ diff --git a/checkpoint4.png b/checkpoint4.png new file mode 100644 index 0000000..d8103d1 Binary files /dev/null and b/checkpoint4.png differ diff --git a/checkpoint5.png b/checkpoint5.png new file mode 100644 index 0000000..d700cc4 Binary files /dev/null and b/checkpoint5.png differ diff --git a/checkpoint6.png b/checkpoint6.png new file mode 100644 index 0000000..e06b84a Binary files /dev/null and b/checkpoint6.png differ diff --git a/checkpoint7.png b/checkpoint7.png new file mode 100644 index 0000000..42c0e6f Binary files /dev/null and b/checkpoint7.png differ diff --git a/checkpoint8.png b/checkpoint8.png new file mode 100644 index 0000000..18fc5ea Binary files /dev/null and b/checkpoint8.png differ diff --git a/example_log.txt b/example_log.txt new file mode 100644 index 0000000..423e97c --- /dev/null +++ b/example_log.txt @@ -0,0 +1,15 @@ +2013-08-09T13:50:33.166Z A 2 +2013-08-09T13:51:33.166Z B 1 +2013-08-09T13:52:33.166Z C 6 +2013-08-09T13:53:33.166Z B 8 +2013-08-09T13:54:33.166Z B 5 +2013-08-09T13:55:33.166Z E 8 +2013-08-09T13:56:33.166Z F 4 +2013-08-09T13:57:33.166Z A 2 +2013-08-09T13:58:33.166Z G 3 +2013-08-09T13:59:33.166Z F 2 +2013-08-09T13:60:33.166Z A 2 +2013-08-09T14:01:33.166Z F 5 +2013-08-09T14:02:33.166Z G 3 +2013-08-09T14:03:33.166Z E 2 +2013-08-09T14:04:33.166Z G 3 \ No newline at end of file diff --git a/my_parser.js b/my_parser.js new file mode 100644 index 0000000..5ee64e7 --- /dev/null +++ b/my_parser.js @@ -0,0 +1,33 @@ +// Load the fs (filesystem) module. +var fs = require('fs');// + +// Read the contents of the file into memory. +fs.readFile('example_log.txt', function (err, logData) { + +// If an error occurred, throwing it will + // display the exception and kill our app. + if (err) throw err; + +// logData is a Buffer, convert to string. + var text = logData.toString(); + +var results = {}; + +// Break up the file into lines. + var lines = text.split('\n'); + +lines.forEach(function(line) { + var parts = line.split(' '); + var letter = parts[1]; + var count = parseInt(parts[2]); + +if(!results[letter]) { + results[letter] = 0; + } + +results[letter] += parseInt(count); + }); + +console.log(results); + // { A: 2, B: 14, C: 6 } +}); \ No newline at end of file diff --git a/my_web_server.js b/my_web_server.js new file mode 100644 index 0000000..b96709f --- /dev/null +++ b/my_web_server.js @@ -0,0 +1,8 @@ +var http = require('http'); + +http.createServer(function (req, res) { + res.writeHead(200, {'Content-Type': 'text/plain'}); + res.end('Hello Logan Bates\n'); +}).listen(8080); + +console.log('Server running on port 8080.'); \ No newline at end of file