GithubHelp home page GithubHelp logo

17214-sp23-rec-08's Introduction

S23-rec8

Task1

generate a free PAT from Clarifai

To run our request, make the following changes:

  1. In ​Main.runWebAPIRequest(), change the variable key to the PAT you generated. ​
  2. In resources/request-body.json, feel free to change the “url” value to that of any food image’s URL (currently the image of a tomato!)

Task2

  1. Go to runSingleAsync, think about the order in which “do other things” and “do other things finished” are printed.Then run the program, verify your answer by observing when these statements are printed out to the console.
  2. Using the runMultipleSynchronous() and runSingleAsync() method for reference, fill in the runMultipleAsynchronous() method to make sure there are at most 10 requests sent to the server at the same time.

More Hints:

  1. Create a list of CompletableFuture objects.
  2. Use a semaphore to limit the number of parallel requests, by acquiring a permit before sending each request with sendAsync(), and releasing it when the request is completed.
  3. Create a list to hold the responses.
  4. Add each CompletableFuture object to the list.
  5. Wait for all the CompletableFuture objects to complete using the join() method.
  6. Retrieve each response and add it to the list of responses.

Task3

In the logging system package we provide a very simple logger implementation that has two hardcoded logging mechanisms. Rewrite the code to use the discovered pattern such that different loggers could be easily configured and added.

17214-sp23-rec-08's People

Contributors

casssie-zhang avatar judysun233 avatar jakezych 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.