Giter Club home page Giter Club logo

csc343-f23-hw1's Introduction

Setting Up Node.js and npm Environment

This guide will help you set up your environment for JavaScript development using Node.js and npm, which is required for this homework.

Prerequisites

Before you begin, make sure you have the following installed on your system:

  • Node.js: A JavaScript runtime that lets you run JavaScript on the server.

Setup

Follow these steps to set up your environment:

  1. Install Node.js and npm:

    Visit the official Node.js website and download the installer for your operating system. The installer will also install npm by default.

  2. Verify Installation:

    After installation, open your terminal and run the following commands to verify that Node.js and npm are installed:

    node -v
    npm -v
    
  3. Checkout a new branch:

    Before you start editing any code, you will need to create a new branch in your GitHub repository to hold your work.

    • You will be given a link generated by GitHub Classroom. Click on the link and follow the instructions there. Github classroom should create a corresponding repository for you containing JS starter code.
    • Go to the repository that GitHub Classroom created for you. It should look like https://github.com/CSC343-HCI-F23/csc343-f23-hw1-<your-username>, where<your-username> is your GitHub username.
    • Create a branch through the GitHub interface.
    • Name your <branch> as yourlastname_yourfirstname_dev (very important , do NOT name it anything else)
    • Clone the repository to your local machine and checkout the branch you just created. Your command must be similar to :
    git clone -b <branch> https://github.com/CSC343-HCI-F23/csc343-f23-hw1-<your-username>.git
    
  4. Install dependencies:

    To install all the dependencies specified in the package.json file, navigate to the root of the repository that you cloned from GitHub and run the following command:

    npm install
    
  5. Write your code: You will implement one function each for each of the sub questions in the programming part of the assignment, Eg:readGraphFromJSON(filePath) inside the class GraphClass(./index.js)

    For Problem 4, you must compute a node degree histogram in the calculateDegreeHistogram() function. The displayHistogram() function should support rendering the histogram in the Google Chrome browser. Use an HTML file named index.html to achieve this.

    Also, you should not edit these files:

    • ./tests.js
    • ./imdb_data.json
    • ./test_data.json
    • .github/workflows/run-tests-on-pull.yml
    • package.json
    • package-lock.json

    Note: The file ./imdb_data.json is the input dataset file you must use as per hw1 guidelines. Please don't edit it or move it. The same applies to ./test_data.json

  6. Test your code: Tests have been provided for you in the ./tests.js file. To run all the provided tests, just type/run npm test from command line from the root of the repository.

    If your code passes the test cases, you will see output like:

      Graph Class
    ✔ test 1: should correctly read and populate nodes from a JSON file
    ✔ test 2: should correctly add edges based on links in data
    ✔ test 3: should correctly compute node degrees and add attributes
    ✔ test 4: should correctly calculate degree histogram
    
    
    4 passing (1ms)
    
  7. Submitting your code:

    As you are working on the code, you should regularly git commit to save your current changes locally and git push to push all saved changes to the remote repository on GitHub.

    To submit your assignment, create a pull request on GitHub, where the "base" branch is "master" or "main", and the "compare" branch is the branch you created at the beginning of this assignment. Then, go to the "Files changed" tab and make sure that all your changes look as you would expect them to.

    There are test cases that will be run automatically (via Github Actions) when a pull request is submitted. These are the same as npm test. So if your code passed npm test in your machine, it’s highly likely that it will pass in GitHub. Nevertheless, you should make sure that you see a green tick mark or a message saying “All Checks Have Passed” like this:

    like this:

    If your test cases are failing, you will get an error message saying "All Checks Have Failed".

    Click on the link which says details and find out what is causing the issue or which test case is not passing. Once you have identified that, close the pull request, fix the errors, and raise another pull request.

    Do not merge the pull request.

    Your instructor will grade the code of this pull request. Pull requests submitted after the deadline won’t be considered. You don't have to submit the code on D2L.

  8. Grading:

    The programming parts of this assignment will be graded primarily on their ability to pass the tests that have been provided to you on GitHub after the pull request. Assignments that pass all, and with the corresponding code implementing the correct logic, will receive at least 30 points.

    To get the remaining of the points, you will be evaluated for correct code implementations to answer the five sub questions in the programming part and whether you generated a correct interpretable histogram of node degrees vs node counts.

csc343-f23-hw1's People

Contributors

hriaz17 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.