Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Done with challenge 3 #47

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
Binary file added Challenge2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ExpressCode/intro-to-express
Submodule intro-to-express added at 066b38
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
# 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)

## Checkpoints

### 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)



Expand All @@ -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)
Binary file added challege2c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge1a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge1b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge1c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge1d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge2a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge2b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge2e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge2f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions example_log.txt
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions my_parser.js
Original file line number Diff line number Diff line change
@@ -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 }
});
8 changes: 8 additions & 0 deletions my_web_server.js
Original file line number Diff line number Diff line change
@@ -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.');