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

Irfan Nadiadi Learning Challenge 6 #22

Open
wants to merge 4 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 Challenges/m1.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 Challenges/m2.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 Challenges/m3.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 Challenges/m4.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 Challenges/t1.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 Challenges/t2.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 Challenges/t3.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 Challenges/t4.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 Challenges/t5.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 Challenges/t6.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 Checkpoints/m1.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 Checkpoints/m2.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 Checkpoints/m3.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 Checkpoints/m4.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 Checkpoints/t1.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 Checkpoints/t2.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 Checkpoints/t3.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 Checkpoints/t4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 25 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,91 @@
# Name

write-your-name
Irfan Nadiadi

# How many points have you earned?

0/100
60/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
4

# What is the most difficult part about this week's challenge?

fill-in-your-answer
I had a tough time getting MongoDB setup in OS X, and eventually gave up and ran it in a VM. I apologize in advance for the incomplete-ness of this challenge, this past week has been very busy for me.

# Show and tell (9 points)

## Link (2 points)

[title-of-the-article](http://link-to-an-article-comparing-nosql-and-sql)
[Comparing SPARQL with SQL](http://www.topquadrant.com/2014/05/05/comparing-sparql-with-sql/)

## What are the limitations of SQL? How are NoSQL solutions trying to address them (name three)? (7 points)

fill-in-your-answer
SQL data is very structured by nature. NoSQL solves this by storing a variety of data, including unstructured data, allowing for much more flexibility in the information stored. SQL databases also require pre-defined schemas, which NoSQL does not. Another big advantage of NoSQL is the ability to manipulate data using object-oriented API's rather than the traditional structured query language.

# Tableau (II) (3 points x 4 + 5 points x 7 = 47 points)

## Checkpoints

### 1 (3 points)

![image](image.png?raw=true)
![image](Checkpoints/t1.png)

### 2 (3 points)

![image](image.png?raw=true)
![image](Checkpoints/t2.png)

### 3 (3 points)

![image](image.png?raw=true)
![image](Checkpoints/t3.png)

### 4 (3 points)

![image](image.png?raw=true)
![image](Checkpoints/t4.png)

## Challenges

### 1 (5 points)

![image](image.png?raw=true)
![image](Challenges/t1.png)

{{one-paragraph-discussion-of-your-answer}}

### 2 (5 points)

![image](image.png?raw=true)
![image](Challenges/t2.png)

{{one-paragraph-discussion-of-your-answer}}

### 3 (5 points)

![image](image.png?raw=true)
![image](Challenges/t3.png)

{{one-paragraph-discussion-of-your-answer}}

### 4 (5 points)

![image](image.png?raw=true)
![image](Challenges/t4.png)

{{one-paragraph-discussion-of-your-answer}}

### 5 (5 points)

![image](image.png?raw=true)
![image](Challenges/t5.png)

{{one-paragraph-discussion-of-your-answer}}

### 6 (5 points)

![image](image.png?raw=true)
![image](Challenges/t6.png)

{{one-paragraph-discussion-of-your-answer}}

### 7 (5 points)

![image](image.png?raw=true)
![image](Challenges/t1.png)

{{one-paragraph-discussion-of-your-answer}}

Expand All @@ -97,43 +96,43 @@ fill-in-your-answer

### 1 (5 points)

![image](image.png?raw=true)
![image](Checkpoints/m1.png)

### 2 (5 points)

![image](image.png?raw=true)
![image](Checkpoints/m2.png)

### 3 (5 points)

![image](image.png?raw=true)
![image](Checkpoints/m3.png)

### 4 (5 points)

![image](image.png?raw=true)
![image](Checkpoints/m4.png)

## Challenges


### 1 (6 points)

![image](image.png?raw=true)
![image](Challenges/m1.png)

[mongodb1.js](mongodb1.js)

### 2 (6 points)

![image](image.png?raw=true)
![image](Challenges/m2.png)

[mongodb2.js](mongodb2.js)

### 3 (6 points)

![image](image.png?raw=true)
![image](Challenges/m3.png)

[mongodb3.js](mongodb3.js)

### 4 (6 points)

![image](image.png?raw=true)
![image](Challenges/m4.png)

[mongodb4.js](mongodb4.js)
29 changes: 29 additions & 0 deletions mongodb1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var rest = require('restler');
var MongoClient = require('mongodb').MongoClient;

MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
if(err) throw err;

console.log(">> Dropping collection");
db.dropCollection('test_insert_github', function(err, result) {
console.log("dropped: ");
console.dir(result);
});

rest.get('https://api.github.com/orgs/CSCI-4830-002-2014/repos').on('complete', function(data) {

// Create a collection to store the results from github
var collection = db.collection('test_insert_github');
collection.insert(data, function(err, docs) {

// Locate all the entries using find
collection.find().toArray(function(err, results) {
results.forEach(function(x){
console.log("name:" + x.name + ", owner.login:" + x.owner.login);
});
// Let's close the db
db.close();
});
});
});
})
29 changes: 29 additions & 0 deletions mongodb1.js~
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var rest = require('restler');
var MongoClient = require('mongodb').MongoClient;

MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
if(err) throw err;

console.log(">> Dropping collection");
db.dropCollection('test_insert_github', function(err, result) {
console.log("dropped: ");
console.dir(result);
});

rest.get('https://api.github.com/repositories').on('complete', function(data) {

// Create a collection to store the results from github
var collection = db.collection('test_insert_github');
collection.insert(data, function(err, docs) {

// Locate all the entries using find
collection.find().toArray(function(err, results) {
results.forEach(function(x){
console.log("name:" + x.name + ", owner.login:" + x.owner.login);
});
// Let's close the db
db.close();
});
});
});
})
29 changes: 29 additions & 0 deletions mongodb2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var rest = require('restler');
var MongoClient = require('mongodb').MongoClient;

MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
if(err) throw err;

console.log(">> Dropping collection");
db.dropCollection('test_insert_github', function(err, result) {
console.log("dropped: ");
console.dir(result);
});

rest.get('https://api.github.com/orgs/CSCI-4830-002-2014/events').on('complete', function(data) {

// Create a collection to store the results from github
var collection = db.collection('test_insert_github');
collection.insert(data, function(err, docs) {

// Locate all the entries using find
collection.find().toArray(function(err, results) {
results.forEach(function(x){
console.log("User:" + x.actor.login + ", type:" + x.type);
});
// Let's close the db
db.close();
});
});
});
})
29 changes: 29 additions & 0 deletions mongodb2.js~
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var rest = require('restler');
var MongoClient = require('mongodb').MongoClient;

MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
if(err) throw err;

console.log(">> Dropping collection");
db.dropCollection('test_insert_github', function(err, result) {
console.log("dropped: ");
console.dir(result);
});

rest.get('https://api.github.com/orgs/CSCI-4830-002-2014/events').on('complete', function(data) {

// Create a collection to store the results from github
var collection = db.collection('test_insert_github');
collection.insert(data, function(err, docs) {

// Locate all the entries using find
collection.find().toArray(function(err, results) {
results.forEach(function(x){
console.log("name:" + x.name + ", owner.login:" + x.owner.login);
});
// Let's close the db
db.close();
});
});
});
})
29 changes: 29 additions & 0 deletions mongodb3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var rest = require('restler');
var MongoClient = require('mongodb').MongoClient;

MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
if(err) throw err;

console.log(">> Dropping collection");
db.dropCollection('test_insert_github', function(err, result) {
console.log("dropped: ");
console.dir(result);
});

rest.get('https://api.github.com/orgs/CSCI-4830-002-2014/events').on('complete', function(data) {

// Create a collection to store the results from github
var collection = db.collection('test_insert_github');
collection.insert(data, function(err, docs) {

// Locate all the entries using find
collection.find().toArray(function(err, results) {
results.forEach(function(x){
console.log("User:" + x.actor.login + ", type:" + x.type);
});
// Let's close the db
db.close();
});
});
});
})
41 changes: 41 additions & 0 deletions mongodb4.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var rest = require('restler');
var MongoClient = require('mongodb').MongoClient;
var async = require('async');


MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
if(err) throw err;

console.log(">> Dropping collection");
db.dropCollection('test_insert_github', function(err, result) {
console.log("dropped: ");
console.dir(result);
});

function getClassEventsForPage(i, callback) {

rest.get('https://api.github.com/orgs/CSCI-4830-002-2014/events').on('complete', function(data) {

// Create a collection to store the results from github
var collection = db.collection('test_insert_github');
collection.insert(data, function(err, docs) {

// Locate all the entries using find
collection.find().toArray(function(err, results) {
results.forEach(function(x){
callback = console.log("User:" + x.actor.login + ", type:" + x.type);
});
// Let's close the db
db.close();
});
});
});
};
async.map([1,2,3,4,5,6,7,8,9,10], getClassEventsForPage, function(err, results) {
});

})




41 changes: 41 additions & 0 deletions mongodb4.js~
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var rest = require('restler');
var MongoClient = require('mongodb').MongoClient;
var async = require('async');


MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
if(err) throw err;

console.log(">> Dropping collection");
db.dropCollection('test_insert_github', function(err, result) {
console.log("dropped: ");
console.dir(result);
});

function getClassEventsForPage(i, callback) {

rest.get('https://api.github.com/orgs/CSCI-4830-002-2014/events').on('complete', function(data) {

// Create a collection to store the results from github
var collection = db.collection('test_insert_github');
collection.insert(data, function(err, docs) {

// Locate all the entries using find
collection.find().toArray(function(err, results) {
results.forEach(function(x){
console.log("User:" + x.actor.login + ", type:" + x.type);
});
// Let's close the db
db.close();
});
});
});
};
async.map([1,2,3,4,5,6,7,8,9,10], getClassEventsForPage, function(err, results) {
});

})